So I’m following Handmade Hero purely off my phone during downtime and basing off of handmade penguin’s adaptation over to linux.
I get execution properly blocking the console on the simple message box dialog, and it renders in termux x11 if i move the mouse over to its location in the x11 app, but I’m never able to see the window render directly after.
❯ ./out/handmade
INFO: Starting application with verbose logging...
DEBUG: Couldn't load font -*-*-medium-r-normal--*-120-*-*-*-*-*-*
DEBUG: That operation is not supported
INFO: OpenGL shaders: ENABLED
INFO: Created renderer: opengl
INFO: Created renderer: software
No clue about the font issue, is that possibly the cause? The last 4 log entries happen directly after the SDL renderer gets called in
Source:
int main(int argc, char *argv[]) {
SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);
SDL_SetHint(SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING, "1");
SDL_Log("Starting application with verbose logging...");
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "Hello", "Hello
, World!", 0);
bool sdlInitialised = SDL_Init(SDL_INIT_VIDEO) == 0;
if (!sdlInitialised) { SDL_Log("Failed SDL Init %s\n", SDL_GetError());
return Quit();
}
SDL_Window *Window =
SDL_CreateWindow("Handmade",
0, 0, 320, 480,
SDL_WINDOW_RESIZABLE);
if (!Window) {
SDL_Log("Post Window SDL Error: %s\n", SDL_GetError());
return Quit();
}
SDL_Renderer *Renderer = SDL_CreateRenderer(Window, -1, SDL_RENDERER
_SOFTWARE);
if (!Renderer) {
SDL_Log("Post Renderer SDL Error: %s\n", SDL_GetError());
return Quit();
}
for(;;)
{
SDL_Event Event;
SDL_WaitEvent(&Event);
if (HandleEvent(&Event))
{
break;
}
}
}
I’ll try pasting the link to repo but I don’t trust my phone not to lose this writeup while I hunt around for it.
Actual source: Handmade/code/sdl_handmade.cpp at b4ead74f07824e579eedecec929a6684598beb34 · BenVella/Handmade · GitHub