Moved GL.hpp to a common.hpp. common.hpp provides includes for SDL2 and OpenGL(ES) and should be included in any file that wishes to access types or functionality provided by either.

master
kts 2015-02-10 01:09:39 -08:00
parent 47ca485855
commit 710712f8c1
8 changed files with 68 additions and 10 deletions

View File

@ -10,6 +10,10 @@
0097E2D912F70C4E00724AC5 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0097E2D512F70C4D00724AC5 /* libSDL2.a */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
20A7A91D1A89F91300EDC1A0 /* RenderCamera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20A7A9151A89F91300EDC1A0 /* RenderCamera.cpp */; };
20A7A91E1A89F91300EDC1A0 /* RenderScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20A7A9171A89F91300EDC1A0 /* RenderScene.cpp */; };
20A7A91F1A89F91300EDC1A0 /* RenderSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20A7A9191A89F91300EDC1A0 /* RenderSet.cpp */; };
20A7A9201A89F91300EDC1A0 /* RenderView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20A7A91B1A89F91300EDC1A0 /* RenderView.cpp */; };
20FD2D3B1A67470A00B32F7B /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20FD2D3A1A67470A00B32F7B /* main.cpp */; };
28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; };
28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; };
@ -82,6 +86,15 @@
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D6058910D05DD3D006BFB54 /* Roll them Bones.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Roll them Bones.app"; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
20020C301A8A006300F985D8 /* common.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = common.hpp; path = ../../src/common.hpp; sourceTree = SOURCE_ROOT; };
20A7A9151A89F91300EDC1A0 /* RenderCamera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderCamera.cpp; path = ../../src/RenderCamera.cpp; sourceTree = SOURCE_ROOT; };
20A7A9161A89F91300EDC1A0 /* RenderCamera.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = RenderCamera.hpp; path = ../../src/RenderCamera.hpp; sourceTree = SOURCE_ROOT; };
20A7A9171A89F91300EDC1A0 /* RenderScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderScene.cpp; path = ../../src/RenderScene.cpp; sourceTree = SOURCE_ROOT; };
20A7A9181A89F91300EDC1A0 /* RenderScene.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = RenderScene.hpp; path = ../../src/RenderScene.hpp; sourceTree = SOURCE_ROOT; };
20A7A9191A89F91300EDC1A0 /* RenderSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderSet.cpp; path = ../../src/RenderSet.cpp; sourceTree = SOURCE_ROOT; };
20A7A91A1A89F91300EDC1A0 /* RenderSet.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = RenderSet.hpp; path = ../../src/RenderSet.hpp; sourceTree = SOURCE_ROOT; };
20A7A91B1A89F91300EDC1A0 /* RenderView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderView.cpp; path = ../../src/RenderView.cpp; sourceTree = SOURCE_ROOT; };
20A7A91C1A89F91300EDC1A0 /* RenderView.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = RenderView.hpp; path = ../../src/RenderView.hpp; sourceTree = SOURCE_ROOT; };
20FD2D3A1A67470A00B32F7B /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = ../../src/main.cpp; sourceTree = SOURCE_ROOT; };
28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
@ -201,10 +214,35 @@
name = Products;
sourceTree = "<group>";
};
20A7A9131A89F8F600EDC1A0 /* Classes */ = {
isa = PBXGroup;
children = (
20A7A9151A89F91300EDC1A0 /* RenderCamera.cpp */,
20A7A9161A89F91300EDC1A0 /* RenderCamera.hpp */,
20A7A9171A89F91300EDC1A0 /* RenderScene.cpp */,
20A7A9181A89F91300EDC1A0 /* RenderScene.hpp */,
20A7A9191A89F91300EDC1A0 /* RenderSet.cpp */,
20A7A91A1A89F91300EDC1A0 /* RenderSet.hpp */,
20A7A91B1A89F91300EDC1A0 /* RenderView.cpp */,
20A7A91C1A89F91300EDC1A0 /* RenderView.hpp */,
);
name = Classes;
sourceTree = "<group>";
};
20A7A9221A89F91B00EDC1A0 /* Other Sources */ = {
isa = PBXGroup;
children = (
20020C301A8A006300F985D8 /* common.hpp */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
29B97315FDCFA39411CA2CEA /* Sources */,
20A7A9131A89F8F600EDC1A0 /* Classes */,
20A7A9221A89F91B00EDC1A0 /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
0097E29812F70C4D00724AC5 /* SDL */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
@ -307,6 +345,10 @@
buildActionMask = 2147483647;
files = (
20FD2D3B1A67470A00B32F7B /* main.cpp in Sources */,
20A7A91D1A89F91300EDC1A0 /* RenderCamera.cpp in Sources */,
20A7A91E1A89F91300EDC1A0 /* RenderScene.cpp in Sources */,
20A7A91F1A89F91300EDC1A0 /* RenderSet.cpp in Sources */,
20A7A9201A89F91300EDC1A0 /* RenderView.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -11,6 +11,8 @@
20138FCE1A3DC7A700FD0095 /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20138FCD1A3DC7A700FD0095 /* SDL2.framework */; };
205D36CE1A6749FB00C05BD8 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 205D36CD1A6749FB00C05BD8 /* main.cpp */; };
205D370C1A674B1D00C05BD8 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 205D370B1A674B1D00C05BD8 /* OpenGL.framework */; };
20A7A8D51A89E11200EDC1A0 /* RenderScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20A7A8D11A89E11200EDC1A0 /* RenderScene.cpp */; };
20A7A8D61A89E11200EDC1A0 /* RenderSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20A7A8D31A89E11200EDC1A0 /* RenderSet.cpp */; };
20A8CE541A899B72004D2504 /* RenderCamera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20A8CE501A899B72004D2504 /* RenderCamera.cpp */; };
20A8CE551A899B72004D2504 /* RenderView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20A8CE521A899B72004D2504 /* RenderView.cpp */; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
@ -18,15 +20,19 @@
/* Begin PBXFileReference section */
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
20020C6F1A8A01EE00F985D8 /* common.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = common.hpp; path = ../../src/common.hpp; sourceTree = SOURCE_ROOT; };
20138FCB1A3DC7A700FD0095 /* SDL2_image.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2_image.framework; path = /Library/Frameworks/SDL2_image.framework; sourceTree = "<absolute>"; };
20138FCD1A3DC7A700FD0095 /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2.framework; path = /Library/Frameworks/SDL2.framework; sourceTree = "<absolute>"; };
205D36CD1A6749FB00C05BD8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = ../../src/main.cpp; sourceTree = SOURCE_ROOT; };
205D370B1A674B1D00C05BD8 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
20A7A8D11A89E11200EDC1A0 /* RenderScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderScene.cpp; path = ../../src/RenderScene.cpp; sourceTree = SOURCE_ROOT; };
20A7A8D21A89E11200EDC1A0 /* RenderScene.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = RenderScene.hpp; path = ../../src/RenderScene.hpp; sourceTree = SOURCE_ROOT; };
20A7A8D31A89E11200EDC1A0 /* RenderSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderSet.cpp; path = ../../src/RenderSet.cpp; sourceTree = SOURCE_ROOT; };
20A7A8D41A89E11200EDC1A0 /* RenderSet.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = RenderSet.hpp; path = ../../src/RenderSet.hpp; sourceTree = SOURCE_ROOT; };
20A8CE501A899B72004D2504 /* RenderCamera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderCamera.cpp; path = ../../src/RenderCamera.cpp; sourceTree = SOURCE_ROOT; };
20A8CE511A899B72004D2504 /* RenderCamera.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = RenderCamera.hpp; path = ../../src/RenderCamera.hpp; sourceTree = SOURCE_ROOT; };
20A8CE521A899B72004D2504 /* RenderView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderView.cpp; path = ../../src/RenderView.cpp; sourceTree = SOURCE_ROOT; };
20A8CE531A899B72004D2504 /* RenderView.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = RenderView.hpp; path = ../../src/RenderView.hpp; sourceTree = SOURCE_ROOT; };
20A8CE681A899CF6004D2504 /* GL.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = GL.hpp; path = ../../src/GL.hpp; sourceTree = SOURCE_ROOT; };
8D1107320486CEB800E47090 /* Roll them Bones.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Roll them Bones.app"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@ -48,6 +54,10 @@
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
20A7A8D11A89E11200EDC1A0 /* RenderScene.cpp */,
20A7A8D21A89E11200EDC1A0 /* RenderScene.hpp */,
20A7A8D31A89E11200EDC1A0 /* RenderSet.cpp */,
20A7A8D41A89E11200EDC1A0 /* RenderSet.hpp */,
20A8CE501A899B72004D2504 /* RenderCamera.cpp */,
20A8CE511A899B72004D2504 /* RenderCamera.hpp */,
20A8CE521A899B72004D2504 /* RenderView.cpp */,
@ -106,7 +116,7 @@
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
20A8CE681A899CF6004D2504 /* GL.hpp */,
20020C6F1A8A01EE00F985D8 /* common.hpp */,
);
name = "Other Sources";
sourceTree = "<group>";
@ -193,6 +203,8 @@
205D36CE1A6749FB00C05BD8 /* main.cpp in Sources */,
20A8CE541A899B72004D2504 /* RenderCamera.cpp in Sources */,
20A8CE551A899B72004D2504 /* RenderView.cpp in Sources */,
20A7A8D51A89E11200EDC1A0 /* RenderScene.cpp in Sources */,
20A7A8D61A89E11200EDC1A0 /* RenderSet.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -9,7 +9,7 @@ RenderScene and outputs all data to the friend class, RenderView.
================================================================ */
#ifndef RENDERCAMERA_HPP
#define RENDERCAMERA_HPP
#include "GL.hpp"
#include "common.hpp"
#include "RenderView.hpp"
class RenderCamera {
public:

View File

@ -9,7 +9,7 @@ each of which correspond to a different scene perspective.
================================================================ */
#ifndef RENDERSCENE_HPP
#define RENDERSCENE_HPP
#include "GL.hpp"
#include "common.hpp"
#include "RenderCamera.hpp"
#include <vector>
class RenderScene {

View File

@ -10,7 +10,7 @@ rendering layers of the program.
================================================================ */
#ifndef RENDERSET_HPP
#define RENDERSET_HPP
#include "GL.hpp"
#include "common.hpp"
#include <vector>
class RenderSet {
public:

View File

@ -9,7 +9,7 @@ purposes, it is a wrapper around a FBO.
================================================================ */
#ifndef RENDERVIEW_HPP
#define RENDERVIEW_HPP
#include "GL.hpp"
#include "common.hpp"
class RenderView {
friend class RenderCamera;
public:

View File

@ -1,6 +1,11 @@
/* ================================================================
This file provides common includes to access OpenGL types and functions
This header provides common includes to SDL2 and OpenGL/OpenGLES
================================================================ */
#if defined(__APPLE__)
#include <TargetConditionals.h>
#endif
#include "SDL.h"
#if defined(__IPHONEOS__) || defined(__ANDROID__)
#define HAVE_OPENGLES
#endif

View File

@ -1,5 +1,4 @@
#include "SDL.h"
#include "GL.hpp"
#include "common.hpp"
int main(int argc, char *argv[]) {
// TEMP location of video vars
@ -12,7 +11,7 @@ int main(int argc, char *argv[]) {
int g_running = 0;
// initialize SDL
if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
if (SDL_Init(SDL_INIT_EVERYTHING & ~SDL_INIT_HAPTIC) != 0) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Init: %s\n", SDL_GetError());
return 1;
}