Commit b5270f9d authored by hybrid's avatar hybrid

Changed the OpenGL header include scheme for OSX. I hope that it does not...

Changed the OpenGL header include scheme for OSX. I hope that it does not break anything as I cannot compile it under OSX. Also some indentation for the OSX stuff.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@865 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d6f8edae
...@@ -24,11 +24,15 @@ ...@@ -24,11 +24,15 @@
#pragma comment(lib, "GLu32.lib") #pragma comment(lib, "GLu32.lib")
#endif #endif
#elif defined(MACOSX) #elif defined(MACOSX)
#define GL_EXT_texture_env_combine 1
#include "CIrrDeviceMacOSX.h" #include "CIrrDeviceMacOSX.h"
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1
#endif
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
#include <OpenGL/glu.h> #include <OpenGL/glu.h>
#include <OpenGL/glext.h> #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#include "glext.h"
#endif
#elif defined(_IRR_USE_SDL_DEVICE_) #elif defined(_IRR_USE_SDL_DEVICE_)
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1 #define GL_GLEXT_LEGACY 1
......
...@@ -21,11 +21,15 @@ ...@@ -21,11 +21,15 @@
#pragma comment(lib, "GLu32.lib") #pragma comment(lib, "GLu32.lib")
#endif #endif
#elif defined(MACOSX) #elif defined(MACOSX)
#define GL_EXT_texture_env_combine 1
#include "CIrrDeviceMacOSX.h" #include "CIrrDeviceMacOSX.h"
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1
#endif
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
#include <OpenGL/glu.h> #include <OpenGL/glu.h>
#include <OpenGL/glext.h> #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#include "glext.h"
#endif
#elif defined(_IRR_USE_SDL_DEVICE_) #elif defined(_IRR_USE_SDL_DEVICE_)
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1 #define GL_GLEXT_LEGACY 1
......
...@@ -9,20 +9,21 @@ ...@@ -9,20 +9,21 @@
#ifdef _IRR_COMPILE_WITH_OPENGL_ #ifdef _IRR_COMPILE_WITH_OPENGL_
#ifdef _IRR_WINDOWS_API_ #ifdef _IRR_WINDOWS_API_
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <GL/gl.h> #include <GL/gl.h>
#include "glext.h" #include "glext.h"
#elif defined(MACOSX)
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
#else #else
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1 #define GL_GLEXT_LEGACY 1
#endif
#if defined(MACOSX)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif #endif
#include <GL/gl.h>
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#include "glext.h" #include "glext.h"
#endif #endif
#endif #endif
......
...@@ -9,19 +9,20 @@ ...@@ -9,19 +9,20 @@
#ifdef _IRR_COMPILE_WITH_OPENGL_ #ifdef _IRR_COMPILE_WITH_OPENGL_
#ifdef _IRR_WINDOWS_API_ #ifdef _IRR_WINDOWS_API_
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <GL/gl.h> #include <GL/gl.h>
#elif defined(MACOSX)
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
#else #else
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1 #define GL_GLEXT_LEGACY 1
#endif
#if defined(MACOSX)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif #endif
#include <GL/gl.h>
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#include "glext.h" #include "glext.h"
#endif #endif
#endif #endif
......
...@@ -22,19 +22,20 @@ ...@@ -22,19 +22,20 @@
#pragma comment(lib, "OpenGL32.lib") #pragma comment(lib, "OpenGL32.lib")
#pragma comment(lib, "GLu32.lib") #pragma comment(lib, "GLu32.lib")
#endif #endif
#elif defined(MACOSX)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <OpenGL/glext.h>
#else #else
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1 #define GL_GLEXT_LEGACY 1
#endif #endif
#if defined(MACOSX)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glu.h>
#endif
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#include "glext.h" #include "glext.h"
#endif #endif
#include <GL/glu.h>
#endif #endif
......
...@@ -41,7 +41,7 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(video::E_DRIVER_TYPE driverType, ...@@ -41,7 +41,7 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(video::E_DRIVER_TYPE driverType,
bool sbuffer, bool vsync, bool sbuffer, bool vsync,
bool antiAlias, IEventReceiver* receiver, bool antiAlias, IEventReceiver* receiver,
const char* version) const char* version)
: CIrrDeviceStub(version, receiver), DriverType(driverType), stencilbuffer(sbuffer) : CIrrDeviceStub(version, receiver), DriverType(driverType), stencilbuffer(sbuffer), _window(NULL), _active(true), _oglcontext(NULL), _cglcontext(NULL)
{ {
struct utsname name; struct utsname name;
NSString *path; NSString *path;
...@@ -64,11 +64,6 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(video::E_DRIVER_TYPE driverType, ...@@ -64,11 +64,6 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(video::E_DRIVER_TYPE driverType,
chdir([path cString]); chdir([path cString]);
} }
_window = NULL;
_active = true;
_oglcontext = NULL;
_cglcontext = NULL;
uname(&name); uname(&name);
Operator = new COSOperator(name.version); Operator = new COSOperator(name.version);
os::Printer::log(name.version,ELL_INFORMATION); os::Printer::log(name.version,ELL_INFORMATION);
...@@ -474,8 +469,10 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event,irr::SEvent &ievent,bool pressed ...@@ -474,8 +469,10 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event,irr::SEvent &ievent,bool pressed
ievent.KeyInput.Control = ([event modifierFlags] & NSControlKeyMask) != 0; ievent.KeyInput.Control = ([event modifierFlags] & NSControlKeyMask) != 0;
ievent.KeyInput.Char = (irr::EKEY_CODE)mchar; ievent.KeyInput.Char = (irr::EKEY_CODE)mchar;
if (skipCommand) ievent.KeyInput.Control = true; if (skipCommand)
else if ([event modifierFlags] & NSCommandKeyMask) [NSApp sendEvent:(NSEvent *)event]; ievent.KeyInput.Control = true;
else if ([event modifierFlags] & NSCommandKeyMask)
[NSApp sendEvent:(NSEvent *)event];
postEventFromUser(ievent); postEventFromUser(ievent);
} }
...@@ -599,11 +596,8 @@ void CIrrDeviceMacOSX::initKeycodes() ...@@ -599,11 +596,8 @@ void CIrrDeviceMacOSX::initKeycodes()
//! Sets if the window should be resizeable in windowed mode. //! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceMacOSX::setResizeAble(bool resize) void CIrrDeviceMacOSX::setResizeAble(bool resize)
{ {
// todo: implement resize // todo: implement resize
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment