ImGui ::Text( "CPU cores: %d", SDL_GetCPUCount()) ImGui ::Begin( "Controls", NULL, ImGuiWindowFlags_NoResize) Std ::cerr (controls_width), static_cast (sdl_height - 20)), If ( !gladLoadGLLoader((GLADloadproc)SDL_GL_GetProcAddress)) SDL_GLContext gl_context = SDL_GL_CreateContext(window) SDL_SetWindowMinimumSize(window, 500, 300) limit to which minimum size user can resize the window SDL_WindowFlags window_flags = (SDL_WindowFlags)( SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2) SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3) SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3) SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0) SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1) SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4) SDL_GL_SetAttribute( // required on Mac OS SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8) SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24) SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1) #include "imgui-style.h" #include "imgui/imgui_impl_sdl.h" #include "imgui/imgui_impl_opengl3.h" #include "functions.h" int windowWidth = 1280, OpenGLįrom lots of supported backends I decided to go with OpenGL.ĬMake knows about it very well because adding it to CMakeLists.txt is very simple: But that’s just me - still a total noob in CMake. List all the files in application directoryĪlmost the most difficult and time consuming part of the whole thing was to make it all work with CMake.Get a string with current date and time.I also continue learning CMake with Visual Studio Code, so that’s what I will be using for building the project. While, in my opinion, it barely can compete with Qt (especially Qt Quick) in terms of beauty and fancy, it is nevertheless a simple, lightweight and quite powerful “framework”. Qt is certainly great, but there are other ways for creating cross-platform GUI, one of such ways being a combination of SDL and Dear ImGui.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |