diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..916e9d3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "deps/glfw"] + path = deps/glfw + url = https://github.com/glfw/glfw.git diff --git a/2dGameProject.sln b/2dGameProject.sln index dad398d..ba45bf2 100644 --- a/2dGameProject.sln +++ b/2dGameProject.sln @@ -1,10 +1,12 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.12.35527.113 d17.12 +VisualStudioVersion = 17.12.35527.113 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2dGameProject", "2dGameProject\2dGameProject.vcxproj", "{D74BE7C6-1564-4E2E-B3E8-9564C0A4156C}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glfw", "deps\glfw\glfw.vcxproj", "{C40453A2-A653-46A2-9AD7-F174540EF26C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -21,6 +23,14 @@ Global {D74BE7C6-1564-4E2E-B3E8-9564C0A4156C}.Release|x64.Build.0 = Release|x64 {D74BE7C6-1564-4E2E-B3E8-9564C0A4156C}.Release|x86.ActiveCfg = Release|Win32 {D74BE7C6-1564-4E2E-B3E8-9564C0A4156C}.Release|x86.Build.0 = Release|Win32 + {C40453A2-A653-46A2-9AD7-F174540EF26C}.Debug|x64.ActiveCfg = Debug|x64 + {C40453A2-A653-46A2-9AD7-F174540EF26C}.Debug|x64.Build.0 = Debug|x64 + {C40453A2-A653-46A2-9AD7-F174540EF26C}.Debug|x86.ActiveCfg = Debug|Win32 + {C40453A2-A653-46A2-9AD7-F174540EF26C}.Debug|x86.Build.0 = Debug|Win32 + {C40453A2-A653-46A2-9AD7-F174540EF26C}.Release|x64.ActiveCfg = Release|x64 + {C40453A2-A653-46A2-9AD7-F174540EF26C}.Release|x64.Build.0 = Release|x64 + {C40453A2-A653-46A2-9AD7-F174540EF26C}.Release|x86.ActiveCfg = Release|Win32 + {C40453A2-A653-46A2-9AD7-F174540EF26C}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/2dGameProject/2dGameProject.vcxproj b/2dGameProject/2dGameProject.vcxproj index c350568..44bb47e 100644 --- a/2dGameProject/2dGameProject.vcxproj +++ b/2dGameProject/2dGameProject.vcxproj @@ -104,10 +104,12 @@ true _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true + C:\Users\piwalker\source\repos\2dGameProject\deps\glfw\include;%(AdditionalIncludeDirectories) Console true + opengl32.lib;%(AdditionalDependencies) @@ -129,6 +131,11 @@ + + + {c40453a2-a653-46a2-9ad7-f174540ef26c} + + diff --git a/2dGameProject/main.cpp b/2dGameProject/main.cpp index 3afc652..f489b0e 100644 --- a/2dGameProject/main.cpp +++ b/2dGameProject/main.cpp @@ -1,7 +1,28 @@ #include +#include int main() { - std::cout << "Hello, World!" << std::endl; - std::cin.get(); + + GLFWwindow* window; + + if (!glfwInit()) + return -1; + + window = glfwCreateWindow(649, 480, "Test", NULL, NULL); + if (!window) { + glfwTerminate(); + return -1; + } + + glfwMakeContextCurrent(window); + + while (!glfwWindowShouldClose(window)) { + glClear(GL_COLOR_BUFFER_BIT); + glfwSwapBuffers(window); + glfwPollEvents(); + } + + glfwTerminate(); + return 0; } \ No newline at end of file diff --git a/deps/glfw b/deps/glfw new file mode 160000 index 0000000..21fea01 --- /dev/null +++ b/deps/glfw @@ -0,0 +1 @@ +Subproject commit 21fea01161e0d6b70c0c5c1f52dc8e7a7df14a50