4 {
5 printf("Initializing Input Test (Result Struct API)...\n");
6 printf("Controls: R=Red, G=Green, B=Blue, ESC=Exit\n");
7
10 printf(
"Failed to init: %d\n", res.
error);
11 return 1;
12 }
13
15 float r = 0.1f, g = 0.2f, b = 0.3f;
16
19
21 r = 1.0f;
22 g = 0.0f;
23 b = 0.0f;
24 }
26 r = 0.0f;
27 g = 1.0f;
28 b = 0.0f;
29 }
31 r = 0.0f;
32 g = 0.0f;
33 b = 1.0f;
34 }
35
37
39
41
43 break;
44 }
45 }
46
49 return 0;
50}
sbgl_InitResult sbgl_Init(int w, int h, const char *title)
Initializes the engine and opens a window.
bool sbgl_WindowShouldClose(sbgl_Context *ctx)
Checks if the user or OS has requested to close the window.
const sbgl_InputState * sbgl_GetInputState(sbgl_Context *ctx)
Retrieves the input state for the current frame.
void sbgl_EndDrawing(sbgl_Context *ctx)
Finalizes the current frame and presents it to the screen.
#define sbgl_Clear
Backward compatibility alias for sbgl_SetClearColor.
void sbgl_DeviceWaitIdle(sbgl_Context *ctx)
Synchronizes the CPU with the GPU, waiting for all commands to complete.
void sbgl_Shutdown(sbgl_Context *ctx)
Gracefully shuts down the engine and releases all resources.
void sbgl_BeginDrawing(sbgl_Context *ctx)
Prepares the engine for a new frame of drawing.
Result structure for initialization.