make the imgui window not be focused by default and put math_graphics into a namespace
This commit is contained in:
parent
a872bede2c
commit
095f94b098
@ -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());
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
namespace M {
|
||||
//clamp
|
||||
constexpr inline float clamp(float min, float a, float max) {
|
||||
float result = a;
|
||||
@ -770,3 +771,4 @@ inline __m128 square_root(__m128 a) {
|
||||
inline __m128 operator /(m128 a, m128 b) {
|
||||
return _mm_div_ps(a.val, b.val);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user