Changeset 11a48af in opengl-game
- Timestamp:
- Jul 19, 2017, 3:01:33 AM (8 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 5272b6b
- Parents:
- 669c4e6 (diff), 1f63bdb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r669c4e6 r11a48af 8 8 .vs/ 9 9 *.filters 10 include/ 11 lib/ 10 12 Debug/ 11 13 Release/ -
OpenGLGame.vcxproj
r669c4e6 r11a48af 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <Project DefaultTargets="Build" ToolsVersion="1 4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">2 <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 3 3 <ItemGroup Label="ProjectConfigurations"> 4 4 <ProjectConfiguration Include="Debug|Win32"> … … 22 22 <ProjectGuid>{592F30FE-3B41-4EE6-A544-23F924C8A1C0}</ProjectGuid> 23 23 <Keyword>Win32Proj</Keyword> 24 <WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion> 24 25 </PropertyGroup> 25 26 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> … … 27 28 <ConfigurationType>Application</ConfigurationType> 28 29 <UseDebugLibraries>true</UseDebugLibraries> 29 <PlatformToolset>v14 0</PlatformToolset>30 <PlatformToolset>v141</PlatformToolset> 30 31 </PropertyGroup> 31 32 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> 32 33 <ConfigurationType>Application</ConfigurationType> 33 34 <UseDebugLibraries>false</UseDebugLibraries> 34 <PlatformToolset>v14 0</PlatformToolset>35 <PlatformToolset>v141</PlatformToolset> 35 36 </PropertyGroup> 36 37 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> 37 38 <ConfigurationType>Application</ConfigurationType> 38 39 <UseDebugLibraries>true</UseDebugLibraries> 39 <PlatformToolset>v14 0</PlatformToolset>40 <PlatformToolset>v141</PlatformToolset> 40 41 </PropertyGroup> 41 42 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> 42 43 <ConfigurationType>Application</ConfigurationType> 43 44 <UseDebugLibraries>false</UseDebugLibraries> 44 <PlatformToolset>v14 0</PlatformToolset>45 <PlatformToolset>v141</PlatformToolset> 45 46 </PropertyGroup> 46 47 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> … … 64 65 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 65 66 <LinkIncremental>true</LinkIncremental> 66 <IncludePath> D:\Visual Studio Projects\include;$(IncludePath)</IncludePath>67 <LibraryPath> D:\Visual Studio Projects\lib;$(LibraryPath)</LibraryPath>67 <IncludePath>C:\Users\dportnoy\Desktop\opengl-game\include;D:\Visual Studio Projects\include;$(IncludePath)</IncludePath> 68 <LibraryPath>C:\Users\dportnoy\Desktop\opengl-game\lib;D:\Visual Studio Projects\lib;$(LibraryPath)</LibraryPath> 68 69 </PropertyGroup> 69 70 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> … … 72 73 <LibraryPath>D:\Visual Studio Projects\lib;$(LibraryPath)</LibraryPath> 73 74 </PropertyGroup> 75 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> 76 <IncludePath>C:\Users\dportnoy\Desktop\opengl-game\include;C:\Users\dportnoy\Desktop\opengl-game\include;$(IncludePath)</IncludePath> 77 <LibraryPath>C:\Users\dportnoy\Desktop\opengl-game\lib;C:\Users\dportnoy\Desktop\opengl-game\lib;$(LibraryPath)</LibraryPath> 78 </PropertyGroup> 74 79 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 75 80 <ClCompile> 76 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE; %(PreprocessorDefinitions)</PreprocessorDefinitions>81 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;GLEW_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions> 77 82 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> 78 83 <WarningLevel>Level3</WarningLevel> … … 108 113 </Link> 109 114 </ItemDefinitionGroup> 115 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> 116 <Link> 117 <AdditionalDependencies> 118 </AdditionalDependencies> 119 </Link> 120 </ItemDefinitionGroup> 110 121 <ItemGroup> 111 <ClCompile Include="game.cpp" /> 122 <ClCompile Include="common\controls-new.cpp" /> 123 <ClCompile Include="common\shader.cpp" /> 124 <ClCompile Include="mygame.cpp" /> 112 125 </ItemGroup> 113 126 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -
README.txt
r669c4e6 r11a48af 1 TODO: Make sure the instructions in this README still work and, if not, update them2 3 1 Installation Instructions for Linux 4 2 --------------------------------------- … … 26 24 --------------------------------------- 27 25 28 Download the precompiled 32bit binaries of GLFW and GLEW. 29 Create /lib and /include folders and add the paths to those folders to the 30 VC++ project. Copy the include/GL and include/GLFW folders into your /include 31 folder and all the files in the include folders of both libraries into your /lib 32 folder. This should be enough to compile and run the project. 26 Download the precompiled 32bit binaries of GLFW, GLEW, and glm (a header-only 27 library). Create lib/ and include/ folders in the root opengl-game directory 28 you cloned. Copy the include/GL/, include/GLFW/, and glm/ folders into your 29 include/ folder and all the files in the lib/ folders of the GLFW and GLEW 30 libraries into your lib/ folder (glm has no lib/ folder). This should be enough 31 to compile and run the project. -
mygame.cpp
r669c4e6 r11a48af 1 // Include standard headers2 1 #include <stdio.h> 3 2 #include <stdlib.h> … … 6 5 using namespace std; 7 6 8 // Include GLEW9 7 #include <GL/glew.h> 10 8 11 // Include GLFW12 9 #include <GLFW/glfw3.h> 13 10 GLFWwindow* window; 14 11 15 // Include GLM16 12 #include <glm/glm.hpp> 17 13 #include <glm/gtc/matrix_transform.hpp> … … 21 17 #include "common/controls.hpp" 22 18 23 int main( void ) 24 { 25 // Initialise GLFW 26 if( !glfwInit() ) 27 { 28 fprintf( stderr, "Failed to initialize GLFW\n" ); 19 int main(int argc, char* argv[]) { 20 if (!glfwInit()) { 21 cerr << "Failed to initialize GLFW" << endl;; 29 22 getchar(); 30 23 return -1; … … 41 34 // Open a window and create its OpenGL context 42 35 window = glfwCreateWindow(mode->width, mode->height, "My Space Game", glfwGetPrimaryMonitor(), NULL); 43 if ( window == NULL ){44 fprintf( stderr, "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials.\n" );36 if (window == NULL) { 37 cerr << "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials." << endl; 45 38 getchar(); 46 39 glfwTerminate(); … … 53 46 glewExperimental = true; // Needed for core profile 54 47 if (glewInit() != GLEW_OK) { 55 fprintf(stderr, "Failed to initialize GLEW\n");48 cout << "Failed to initialize GLEW\n" << endl; 56 49 getchar(); 57 50 glfwTerminate(); … … 221 214 do { 222 215 223 // Clear the screen224 216 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 225 217 226 // Use our shader227 218 glUseProgram(programID); 228 219 … … 232 223 glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.0f); 233 224 234 // Camera matrix235 /*236 glm::mat4 View = glm::lookAt(237 glm::vec3(4,3,-3), // Camera is at (4,3,-3), in World Space238 glm::vec3(0,0,0), // and looks at the origin239 glm::vec3(0,1,0) // Head is up (set to 0,-1,0 to look upside-down)240 );241 */242 225 glm::mat4 View = getViewMatrix(); 243 226
Note:
See TracChangeset
for help on using the changeset viewer.