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


Ignore:
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

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

    r669c4e6 r11a48af  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
     2<Project DefaultTargets="Build" ToolsVersion="15.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>
    2425  </PropertyGroup>
    2526  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
     
    2728    <ConfigurationType>Application</ConfigurationType>
    2829    <UseDebugLibraries>true</UseDebugLibraries>
    29     <PlatformToolset>v140</PlatformToolset>
     30    <PlatformToolset>v141</PlatformToolset>
    3031  </PropertyGroup>
    3132  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    3233    <ConfigurationType>Application</ConfigurationType>
    3334    <UseDebugLibraries>false</UseDebugLibraries>
    34     <PlatformToolset>v140</PlatformToolset>
     35    <PlatformToolset>v141</PlatformToolset>
    3536  </PropertyGroup>
    3637  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    3738    <ConfigurationType>Application</ConfigurationType>
    3839    <UseDebugLibraries>true</UseDebugLibraries>
    39     <PlatformToolset>v140</PlatformToolset>
     40    <PlatformToolset>v141</PlatformToolset>
    4041  </PropertyGroup>
    4142  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    4243    <ConfigurationType>Application</ConfigurationType>
    4344    <UseDebugLibraries>false</UseDebugLibraries>
    44     <PlatformToolset>v140</PlatformToolset>
     45    <PlatformToolset>v141</PlatformToolset>
    4546  </PropertyGroup>
    4647  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
     
    6465  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    6566    <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>
    6869  </PropertyGroup>
    6970  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     
    7273    <LibraryPath>D:\Visual Studio Projects\lib;$(LibraryPath)</LibraryPath>
    7374  </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>
    7479  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    7580    <ClCompile>
    76       <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     81      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;GLEW_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    7782      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
    7883      <WarningLevel>Level3</WarningLevel>
     
    108113    </Link>
    109114  </ItemDefinitionGroup>
     115  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     116    <Link>
     117      <AdditionalDependencies>
     118      </AdditionalDependencies>
     119    </Link>
     120  </ItemDefinitionGroup>
    110121  <ItemGroup>
    111     <ClCompile Include="game.cpp" />
     122    <ClCompile Include="common\controls-new.cpp" />
     123    <ClCompile Include="common\shader.cpp" />
     124    <ClCompile Include="mygame.cpp" />
    112125  </ItemGroup>
    113126  <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 them
    2 
    31Installation Instructions for Linux
    42---------------------------------------
     
    2624---------------------------------------
    2725
    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.
     26Download the precompiled 32bit binaries of GLFW, GLEW, and glm (a header-only
     27library). Create lib/ and include/ folders in the root opengl-game directory
     28you cloned. Copy the include/GL/, include/GLFW/, and glm/ folders into your
     29include/ folder and all the files in the lib/ folders of the GLFW and GLEW
     30libraries into your lib/ folder (glm has no lib/ folder). This should be enough
     31to compile and run the project.
  • mygame.cpp

    r669c4e6 r11a48af  
    1 // Include standard headers
    21#include <stdio.h>
    32#include <stdlib.h>
     
    65using namespace std;
    76
    8 // Include GLEW
    97#include <GL/glew.h>
    108
    11 // Include GLFW
    129#include <GLFW/glfw3.h>
    1310GLFWwindow* window;
    1411
    15 // Include GLM
    1612#include <glm/glm.hpp>
    1713#include <glm/gtc/matrix_transform.hpp>
     
    2117#include "common/controls.hpp"
    2218
    23 int main( void )
    24 {
    25         // Initialise GLFW
    26         if( !glfwInit() )
    27         {
    28                 fprintf( stderr, "Failed to initialize GLFW\n" );
     19int main(int argc, char* argv[]) {
     20        if (!glfwInit()) {
     21                cerr << "Failed to initialize GLFW" << endl;;
    2922                getchar();
    3023                return -1;
     
    4134  // Open a window and create its OpenGL context
    4235  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;
    4538                getchar();
    4639                glfwTerminate();
     
    5346        glewExperimental = true; // Needed for core profile
    5447        if (glewInit() != GLEW_OK) {
    55                 fprintf(stderr, "Failed to initialize GLEW\n");
     48                cout << "Failed to initialize GLEW\n" << endl;
    5649                getchar();
    5750                glfwTerminate();
     
    221214  do {
    222215
    223     // Clear the screen
    224216    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    225217
    226     // Use our shader
    227218    glUseProgram(programID);
    228219
     
    232223    glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.0f);
    233224
    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     */
    242225    glm::mat4 View = getViewMatrix();
    243226
Note: See TracChangeset for help on using the changeset viewer.