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-05-31 23:34:19 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::setDisplay()
|
2010-05-31 19:32:36 +00:00
|
|
|
bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable);
|
|
|
|
|
2010-06-08 21:27:06 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::setMode()
|
|
|
|
bool setMode(const GfxMode& mode);
|
|
|
|
|
2010-06-13 18:24:58 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::getCurrentScreenMode()
|
|
|
|
void getCurrentScreenMode(GfxMode& mode);
|
|
|
|
|
2010-05-31 23:34:19 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::getWindowSize()
|
|
|
|
void getWindowSize(uint32 &width, uint32 &height);
|
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::getWindowPos()
|
2010-06-13 18:24:58 +00:00
|
|
|
void getWindowPos(sint32 &x, sint32 &y);
|
2010-05-31 23:34:19 +00:00
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::setWindowPos()
|
2010-06-13 18:24:58 +00:00
|
|
|
void setWindowPos(sint32 x, sint32 y);
|
2010-05-31 23:34:19 +00:00
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::setWindowTitle()
|
|
|
|
void setWindowTitle(const ucstring &title);
|
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::swapBuffers()
|
2010-05-31 19:32:36 +00:00
|
|
|
void swapBuffers();
|
|
|
|
|
2010-06-09 21:15:14 +00:00
|
|
|
/// mac specific stuff while calling CDriverGL::setCapture()
|
|
|
|
void setCapture(bool b);
|
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::showCursor()
|
|
|
|
void showCursor(bool b);
|
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::setMousePos()
|
|
|
|
void setMousePos(float x, float y);
|
|
|
|
|
|
|
|
/// mac specific stuff while calling CDriverGL::release()
|
|
|
|
void release();
|
|
|
|
|
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
|