add glm, fix project name

This commit is contained in:
det-fys 2024-09-22 10:49:50 +02:00
parent c4abb6750f
commit 1e08c45f0c
5 changed files with 15 additions and 11 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
.vs/
.vscode/
build/ build/
bin/ bin/
out/ out/
*.log

View File

@ -27,7 +27,7 @@ echo:
echo Kopiruji exe do bin... echo Kopiruji exe do bin...
echo: echo:
copy %BUILD_TYPE%\MyOpenGLApp.exe ..\bin\MyOpenGLApp.exe copy %BUILD_TYPE%\MyOpenGLProject.exe ..\bin\MyOpenGLProject.exe
echo: echo:
echo Hotovo echo Hotovo

View File

@ -10,12 +10,13 @@ if(WIN32)
# Use FetchContent to download GLFW and ImGui # Use FetchContent to download GLFW and ImGui
include(FetchContent) include(FetchContent)
# download GLM
FetchContent_Declare( FetchContent_Declare(
glad glm
GIT_REPOSITORY https://github.com/Dav1dde/glad.git GIT_REPOSITORY https://github.com/g-truc/glm.git
GIT_TAG v2.0.7 # Latest version at the time of writing GIT_TAG bf71a834948186f4097caa076cd2663c69a10e1e #refs/tags/1.0.1
) )
FetchContent_MakeAvailable(glad) FetchContent_MakeAvailable(glm)
# Download GLFW # Download GLFW
FetchContent_Declare( FetchContent_Declare(
@ -55,10 +56,10 @@ if(WIN32)
) )
# Define your executable and include ImGui and backend sources # Define your executable and include ImGui and backend sources
add_executable(MyOpenGLApp WIN32 ${APP_SOURCES} ${IMGUI_SOURCES}) add_executable(${PROJECT_NAME} WIN32 ${APP_SOURCES} ${IMGUI_SOURCES})
# Include directories for ImGui, GLEW, and GLFW # Include directories for ImGui, GLEW, and GLFW
target_include_directories(MyOpenGLApp PRIVATE target_include_directories(${PROJECT_NAME} PRIVATE
${imgui_SOURCE_DIR} ${imgui_SOURCE_DIR}
${IMGUI_BACKENDS} ${IMGUI_BACKENDS}
${glfw_SOURCE_DIR}/include ${glfw_SOURCE_DIR}/include
@ -66,9 +67,10 @@ if(WIN32)
) )
# Link against Windows-specific libraries, GLEW, GLFW, and OpenGL # Link against Windows-specific libraries, GLEW, GLFW, and OpenGL
target_link_libraries(MyOpenGLApp PRIVATE target_link_libraries(${PROJECT_NAME} PRIVATE
glfw glfw
glad glad
glm::glm
) )
# Define GLEW_STATIC for static linking of GLEW # Define GLEW_STATIC for static linking of GLEW

View File

@ -1 +1 @@
start /D bin MyOpenGLApp start /D bin MyOpenGLProject

View File

@ -3,6 +3,7 @@
#include "imgui.h" #include "imgui.h"
#include "imgui_impl_glfw.h" #include "imgui_impl_glfw.h"
#include "imgui_impl_opengl3.h" #include "imgui_impl_opengl3.h"
//#include <glm/glm.hpp>
#include <iostream> #include <iostream>
#define NOMINMAX #define NOMINMAX
@ -48,7 +49,7 @@ int main() {
IMGUI_CHECKVERSION(); IMGUI_CHECKVERSION();
ImGui::CreateContext(); ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); //(void)io; ImGuiIO& io = ImGui::GetIO(); //(void)io;
io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\segoeui.ttf", 18); // io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\segoeui.ttf", 18);
// Setup Dear ImGui style // Setup Dear ImGui style
ImGui::StyleColorsDark(); ImGui::StyleColorsDark();