2010-05-31 19:32:36 +00:00
|
|
|
/*
|
|
|
|
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
|
|
|
// Copyright (C) 2010 Winch Gate Property Limited
|
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Affero General Public License as
|
|
|
|
// published by the Free Software Foundation, either version 3 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU Affero General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NL_DRIVER_OPENGL_MAC_COCOA_ADAPTER_H
|
|
|
|
#define NL_DRIVER_OPENGL_MAC_COCOA_ADAPTER_H
|
|
|
|
|
|
|
|
#include "nel/misc/types_nl.h"
|
|
|
|
#include "nel/misc/event_server.h"
|
|
|
|
#include "nel/3d/driver.h"
|
|
|
|
|
|
|
|
#include "cocoa_event_emitter.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* this cocoa adapter is a helper to call functions executing obj-c code
|
|
|
|
* from driver_opengl.cpp
|
|
|
|
*
|
|
|
|
* please see this as a temporary solution... there is some stuff concerning
|
|
|
|
* driver refactoring going on anyway as far as i know
|
|
|
|
*
|
|
|
|
* this can as well be seen as a preparation to pull platform specific code
|
|
|
|
* out of driver_opengl.cpp ;)
|
2010-05-31 23:34:19 +00:00
|
|
|
*
|
|
|
|
* btw: we cannot simply use a c++ class here, because then NSWindow* and friends
|
|
|
|
* would be members, but then we would need to add obj-c code here using an
|
|
|
|
* include or a forward declaration. this again would break compiling cpp files
|
|
|
|
* including this one (eg. driver_opengl.cpp)
|
2010-05-31 19:32:36 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace NL3D { namespace MAC {
|
|
|
|
|
2010-05-31 23:34:19 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::CDriverGL()
|
2010-05-31 19:32:36 +00:00
|
|
|
void ctor();
|
|
|
|
|
2010-05-31 23:34:19 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::~CDriverGL()
|
2010-05-31 19:32:36 +00:00
|
|
|
void dtor();
|
|
|
|
|
2010-05-31 23:34:19 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::init()
|
2010-05-31 19:32:36 +00:00
|
|
|
bool init(uint windowIcon = 0, emptyProc exitFunc = 0);
|
|
|
|
|
2010-06-23 21:37:19 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::unInit()
|
|
|
|
bool unInit();
|
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::createWindow()
|
|
|
|
nlWindow createWindow(const GfxMode& mode);
|
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::destroyWindow()
|
|
|
|
bool destroyWindow(nlWindow wnd);
|
|
|
|
|
2010-05-31 23:34:19 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::setDisplay()
|
2010-06-23 21:37:19 +00:00
|
|
|
nlWindow setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable);
|
2010-05-31 19:32:36 +00:00
|
|
|
|
2010-06-23 21:37:19 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::setWindowStyle()
|
|
|
|
bool setWindowStyle(nlWindow wnd, bool fullscreen);
|
2010-06-08 21:27:06 +00:00
|
|
|
|
2010-06-13 18:24:58 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::getCurrentScreenMode()
|
2010-06-23 21:37:19 +00:00
|
|
|
void getCurrentScreenMode(nlWindow wnd, GfxMode& mode);
|
2010-06-13 18:24:58 +00:00
|
|
|
|
2010-05-31 23:34:19 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::getWindowSize()
|
2010-06-23 21:37:19 +00:00
|
|
|
void getWindowSize(nlWindow wnd, uint32 &width, uint32 &height);
|
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::setWindowSize()
|
|
|
|
void setWindowSize(nlWindow wnd, uint32 width, uint32 height);
|
2010-05-31 23:34:19 +00:00
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::getWindowPos()
|
2010-06-23 21:37:19 +00:00
|
|
|
void getWindowPos(nlWindow wnd, sint32 &x, sint32 &y);
|
2010-05-31 23:34:19 +00:00
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::setWindowPos()
|
2010-06-23 21:37:19 +00:00
|
|
|
void setWindowPos(nlWindow wnd, sint32 x, sint32 y);
|
2010-05-31 23:34:19 +00:00
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::setWindowTitle()
|
2010-06-23 21:37:19 +00:00
|
|
|
void setWindowTitle(nlWindow wnd, const ucstring& title);
|
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::showWindow()
|
|
|
|
void showWindow(bool show);
|
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::activate()
|
|
|
|
bool activate(nlWindow wnd);
|
2010-05-31 23:34:19 +00:00
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::swapBuffers()
|
2010-06-23 21:37:19 +00:00
|
|
|
void swapBuffers(nlWindow wnd);
|
2010-05-31 19:32:36 +00:00
|
|
|
|
2010-06-09 21:15:14 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::setCapture()
|
2010-06-23 21:37:19 +00:00
|
|
|
void setCapture(bool capture);
|
2010-06-09 21:15:14 +00:00
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::showCursor()
|
2010-06-23 21:37:19 +00:00
|
|
|
void showCursor(bool show);
|
2010-06-09 21:15:14 +00:00
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::setMousePos()
|
2010-06-23 21:37:19 +00:00
|
|
|
void setMousePos(nlWindow wnd, float x, float y);
|
2010-06-09 21:15:14 +00:00
|
|
|
|
2010-05-31 23:34:19 +00:00
|
|
|
/// mac specific stuff while calling CCocoaEventEmitter::submitEvents()
|
2010-05-31 19:32:36 +00:00
|
|
|
void submitEvents(NLMISC::CEventServer& server,
|
|
|
|
bool allWindows, NLMISC::CCocoaEventEmitter* eventEmitter);
|
|
|
|
|
2010-06-11 13:04:10 +00:00
|
|
|
/// mac specific stuff while calling CCocoaEventEmitter::emulateMouseRawMode()
|
|
|
|
void emulateMouseRawMode(bool enable);
|
|
|
|
|
2010-05-31 19:32:36 +00:00
|
|
|
}}
|
|
|
|
|
|
|
|
#endif
|