Changes in / [11a48af:669c4e6] in opengl-game
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r11a48af r669c4e6 8 8 .vs/ 9 9 *.filters 10 include/11 lib/12 10 Debug/ 13 11 Release/ -
OpenGLGame.vcxproj
r11a48af r669c4e6 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <Project DefaultTargets="Build" ToolsVersion="1 5.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">2 <Project DefaultTargets="Build" ToolsVersion="14.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>25 24 </PropertyGroup> 26 25 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> … … 28 27 <ConfigurationType>Application</ConfigurationType> 29 28 <UseDebugLibraries>true</UseDebugLibraries> 30 <PlatformToolset>v14 1</PlatformToolset>29 <PlatformToolset>v140</PlatformToolset> 31 30 </PropertyGroup> 32 31 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> 33 32 <ConfigurationType>Application</ConfigurationType> 34 33 <UseDebugLibraries>false</UseDebugLibraries> 35 <PlatformToolset>v14 1</PlatformToolset>34 <PlatformToolset>v140</PlatformToolset> 36 35 </PropertyGroup> 37 36 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> 38 37 <ConfigurationType>Application</ConfigurationType> 39 38 <UseDebugLibraries>true</UseDebugLibraries> 40 <PlatformToolset>v14 1</PlatformToolset>39 <PlatformToolset>v140</PlatformToolset> 41 40 </PropertyGroup> 42 41 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> 43 42 <ConfigurationType>Application</ConfigurationType> 44 43 <UseDebugLibraries>false</UseDebugLibraries> 45 <PlatformToolset>v14 1</PlatformToolset>44 <PlatformToolset>v140</PlatformToolset> 46 45 </PropertyGroup> 47 46 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> … … 65 64 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 66 65 <LinkIncremental>true</LinkIncremental> 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>66 <IncludePath>D:\Visual Studio Projects\include;$(IncludePath)</IncludePath> 67 <LibraryPath>D:\Visual Studio Projects\lib;$(LibraryPath)</LibraryPath> 69 68 </PropertyGroup> 70 69 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> … … 73 72 <LibraryPath>D:\Visual Studio Projects\lib;$(LibraryPath)</LibraryPath> 74 73 </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>79 74 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 80 75 <ClCompile> 81 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE; GLEW_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>76 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> 82 77 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> 83 78 <WarningLevel>Level3</WarningLevel> … … 113 108 </Link> 114 109 </ItemDefinitionGroup> 115 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">116 <Link>117 <AdditionalDependencies>118 </AdditionalDependencies>119 </Link>120 </ItemDefinitionGroup>121 110 <ItemGroup> 122 <ClCompile Include="common\controls-new.cpp" /> 123 <ClCompile Include="common\shader.cpp" /> 124 <ClCompile Include="mygame.cpp" /> 111 <ClCompile Include="game.cpp" /> 125 112 </ItemGroup> 126 113 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -
README.txt
r11a48af r669c4e6 1 TODO: Make sure the instructions in this README still work and, if not, update them 2 1 3 Installation Instructions for Linux 2 4 --------------------------------------- … … 24 26 --------------------------------------- 25 27 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. 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. -
mygame.cpp
r11a48af r669c4e6 1 // Include standard headers 1 2 #include <stdio.h> 2 3 #include <stdlib.h> … … 5 6 using namespace std; 6 7 8 // Include GLEW 7 9 #include <GL/glew.h> 8 10 11 // Include GLFW 9 12 #include <GLFW/glfw3.h> 10 13 GLFWwindow* window; 11 14 15 // Include GLM 12 16 #include <glm/glm.hpp> 13 17 #include <glm/gtc/matrix_transform.hpp> … … 17 21 #include "common/controls.hpp" 18 22 19 int main(int argc, char* argv[]) { 20 if (!glfwInit()) { 21 cerr << "Failed to initialize GLFW" << endl;; 23 int main( void ) 24 { 25 // Initialise GLFW 26 if( !glfwInit() ) 27 { 28 fprintf( stderr, "Failed to initialize GLFW\n" ); 22 29 getchar(); 23 30 return -1; … … 34 41 // Open a window and create its OpenGL context 35 42 window = glfwCreateWindow(mode->width, mode->height, "My Space Game", glfwGetPrimaryMonitor(), NULL); 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;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" ); 38 45 getchar(); 39 46 glfwTerminate(); … … 46 53 glewExperimental = true; // Needed for core profile 47 54 if (glewInit() != GLEW_OK) { 48 cout << "Failed to initialize GLEW\n" << endl;55 fprintf(stderr, "Failed to initialize GLEW\n"); 49 56 getchar(); 50 57 glfwTerminate(); … … 214 221 do { 215 222 223 // Clear the screen 216 224 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 217 225 226 // Use our shader 218 227 glUseProgram(programID); 219 228 … … 223 232 glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.0f); 224 233 234 // Camera matrix 235 /* 236 glm::mat4 View = glm::lookAt( 237 glm::vec3(4,3,-3), // Camera is at (4,3,-3), in World Space 238 glm::vec3(0,0,0), // and looks at the origin 239 glm::vec3(0,1,0) // Head is up (set to 0,-1,0 to look upside-down) 240 ); 241 */ 225 242 glm::mat4 View = getViewMatrix(); 226 243
Note:
See TracChangeset
for help on using the changeset viewer.