make the imgui window not be focused by default and put math_graphics into a namespace

This commit is contained in:
Sven Balzer 2025-02-26 14:16:48 +01:00
parent a872bede2c
commit 095f94b098
2 changed files with 746 additions and 735 deletions

View File

@ -2,6 +2,7 @@
#include <stdint.h>
#include <SDL3/SDL.h>
#include <imgui.h>
#include <imgui_internal.h>
#include <imgui_impl_sdl3.h>
#include <imgui_impl_sdlgpu3.h>
@ -14,6 +15,8 @@
#include "../assets/shader/basic_vertex_shader.h"
#include "../assets/shader/basic_pixel_shader.h"
using namespace M;
SDL_GPUDevice *device;
SDL_Window *window;
@ -750,6 +753,7 @@ int main(int argc, char **argv) {
ImGui_ImplSDLGPU3_Init(&imgui_init_info);
bool show_demo_window = true;
bool first_frame = true;
// MSG Message;
while (Running) {
@ -760,6 +764,11 @@ int main(int argc, char **argv) {
if (show_demo_window)
ImGui::ShowDemoWindow(&show_demo_window);
if (first_frame) {
ImGui::SetWindowFocus(NULL);
first_frame = false;
}
SDL_GPUCommandBuffer *command_buffer = SDL_AcquireGPUCommandBuffer(device);
if (!command_buffer) {
log_error("Failed to acquire gpu command buffer (%s). Exiting.", SDL_GetError());

File diff suppressed because it is too large Load Diff