Create PlatformUtils.h to handle cross platform compatibility
This commit is contained in:
parent
5f415e4f1b
commit
dcd82ae202
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <windows.h>
|
//#include <windows.h>
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef __INITSHADER_H__
|
#ifndef __INITSHADER_H__
|
||||||
#define __INITSHADER_H__
|
#define __INITSHADER_H__
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
#include <GL/GL.h>
|
#include <GL/GL.h>
|
||||||
|
|
||||||
GLuint InitShader( const char* computeShaderFile);
|
GLuint InitShader( const char* computeShaderFile);
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#define DEBUG_BREAK() DebugBreak()
|
||||||
|
#else
|
||||||
|
#include <csignal>
|
||||||
|
#define DEBUG_BREAK() raise(SIGTRAP)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef APIENTRY
|
||||||
|
#define APIENTRY
|
||||||
|
#endif
|
|
@ -1,5 +1,6 @@
|
||||||
#include "Callbacks.h"
|
#include "Callbacks.h"
|
||||||
#include "Scene.h"
|
#include "PlatformUtils.h"
|
||||||
|
#include "scene.h"
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
void Callbacks::Register(GLFWwindow* window)
|
void Callbacks::Register(GLFWwindow* window)
|
||||||
|
|
|
@ -26,6 +26,7 @@ void RegisterDebugCallback()
|
||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
#include <windows.h>
|
||||||
/* Only run this code on WindowsAPI systems, otherwise use cout */
|
/* Only run this code on WindowsAPI systems, otherwise use cout */
|
||||||
|
|
||||||
// C-based callback implementation
|
// C-based callback implementation
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
//#include "LoadTexture.h" //Functions for creating OpenGL textures from image files
|
//#include "LoadTexture.h" //Functions for creating OpenGL textures from image files
|
||||||
//#include "VideoRecorder.h" //Functions for saving videos
|
//#include "VideoRecorder.h" //Functions for saving videos
|
||||||
#include "DebugCallback.h"
|
#include "DebugCallback.h"
|
||||||
|
#include "PlatformUtils.h"
|
||||||
|
|
||||||
static const std::string vertex_shader("shaders/vertex.glsl");
|
static const std::string vertex_shader("shaders/vertex.glsl");
|
||||||
static const std::string fragment_shader("shaders/fragment.glsl");
|
static const std::string fragment_shader("shaders/fragment.glsl");
|
||||||
|
|
Loading…
Reference in New Issue