Changes in / [11a48af:669c4e6] in opengl-game


Ignore:
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r11a48af r669c4e6  
    88.vs/
    99*.filters
    10 include/
    11 lib/
    1210Debug/
    1311Release/
  • OpenGLGame.vcxproj

    r11a48af r669c4e6  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
     2<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    33  <ItemGroup Label="ProjectConfigurations">
    44    <ProjectConfiguration Include="Debug|Win32">
     
    2222    <ProjectGuid>{592F30FE-3B41-4EE6-A544-23F924C8A1C0}</ProjectGuid>
    2323    <Keyword>Win32Proj</Keyword>
    24     <WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
    2524  </PropertyGroup>
    2625  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
     
    2827    <ConfigurationType>Application</ConfigurationType>
    2928    <UseDebugLibraries>true</UseDebugLibraries>
    30     <PlatformToolset>v141</PlatformToolset>
     29    <PlatformToolset>v140</PlatformToolset>
    3130  </PropertyGroup>
    3231  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    3332    <ConfigurationType>Application</ConfigurationType>
    3433    <UseDebugLibraries>false</UseDebugLibraries>
    35     <PlatformToolset>v141</PlatformToolset>
     34    <PlatformToolset>v140</PlatformToolset>
    3635  </PropertyGroup>
    3736  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    3837    <ConfigurationType>Application</ConfigurationType>
    3938    <UseDebugLibraries>true</UseDebugLibraries>
    40     <PlatformToolset>v141</PlatformToolset>
     39    <PlatformToolset>v140</PlatformToolset>
    4140  </PropertyGroup>
    4241  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    4342    <ConfigurationType>Application</ConfigurationType>
    4443    <UseDebugLibraries>false</UseDebugLibraries>
    45     <PlatformToolset>v141</PlatformToolset>
     44    <PlatformToolset>v140</PlatformToolset>
    4645  </PropertyGroup>
    4746  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
     
    6564  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    6665    <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>
    6968  </PropertyGroup>
    7069  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     
    7372    <LibraryPath>D:\Visual Studio Projects\lib;$(LibraryPath)</LibraryPath>
    7473  </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>
    7974  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    8075    <ClCompile>
    81       <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;GLEW_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     76      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    8277      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
    8378      <WarningLevel>Level3</WarningLevel>
     
    113108    </Link>
    114109  </ItemDefinitionGroup>
    115   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    116     <Link>
    117       <AdditionalDependencies>
    118       </AdditionalDependencies>
    119     </Link>
    120   </ItemDefinitionGroup>
    121110  <ItemGroup>
    122     <ClCompile Include="common\controls-new.cpp" />
    123     <ClCompile Include="common\shader.cpp" />
    124     <ClCompile Include="mygame.cpp" />
     111    <ClCompile Include="game.cpp" />
    125112  </ItemGroup>
    126113  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  • README.txt

    r11a48af r669c4e6  
     1TODO: Make sure the instructions in this README still work and, if not, update them
     2
    13Installation Instructions for Linux
    24---------------------------------------
     
    2426---------------------------------------
    2527
    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.
     28Download the precompiled 32bit binaries of GLFW and GLEW.
     29Create /lib and /include folders and add the paths to those folders to the
     30VC++ project. Copy the include/GL and include/GLFW folders into your /include
     31folder and all the files in the include folders of both libraries into your /lib
     32folder. This should be enough to compile and run the project.
  • mygame.cpp

    r11a48af r669c4e6  
     1// Include standard headers
    12#include <stdio.h>
    23#include <stdlib.h>
     
    56using namespace std;
    67
     8// Include GLEW
    79#include <GL/glew.h>
    810
     11// Include GLFW
    912#include <GLFW/glfw3.h>
    1013GLFWwindow* window;
    1114
     15// Include GLM
    1216#include <glm/glm.hpp>
    1317#include <glm/gtc/matrix_transform.hpp>
     
    1721#include "common/controls.hpp"
    1822
    19 int main(int argc, char* argv[]) {
    20         if (!glfwInit()) {
    21                 cerr << "Failed to initialize GLFW" << endl;;
     23int main( void )
     24{
     25        // Initialise GLFW
     26        if( !glfwInit() )
     27        {
     28                fprintf( stderr, "Failed to initialize GLFW\n" );
    2229                getchar();
    2330                return -1;
     
    3441  // Open a window and create its OpenGL context
    3542  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" );
    3845                getchar();
    3946                glfwTerminate();
     
    4653        glewExperimental = true; // Needed for core profile
    4754        if (glewInit() != GLEW_OK) {
    48                 cout << "Failed to initialize GLEW\n" << endl;
     55                fprintf(stderr, "Failed to initialize GLEW\n");
    4956                getchar();
    5057                glfwTerminate();
     
    214221  do {
    215222
     223    // Clear the screen
    216224    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    217225
     226    // Use our shader
    218227    glUseProgram(programID);
    219228
     
    223232    glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.0f);
    224233
     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    */
    225242    glm::mat4 View = getViewMatrix();
    226243
Note: See TracChangeset for help on using the changeset viewer.