mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
reformat for panda conventions
This commit is contained in:
parent
2820bca34b
commit
4a70282208
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
Configure(config_osxdisplay);
|
Configure(config_osxdisplay);
|
||||||
|
|
||||||
NotifyCategoryDef( osxdisplay , "display");
|
NotifyCategoryDef(osxdisplay, "display");
|
||||||
|
|
||||||
ConfigureFn(config_osxdisplay) {
|
ConfigureFn(config_osxdisplay) {
|
||||||
init_libosxdisplay();
|
init_libosxdisplay();
|
||||||
@ -70,8 +70,6 @@ init_libosxdisplay() {
|
|||||||
osxGraphicsWindow::init_type();
|
osxGraphicsWindow::init_type();
|
||||||
osxGraphicsStateGuardian::init_type();
|
osxGraphicsStateGuardian::init_type();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr();
|
GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr();
|
||||||
selection->add_pipe_type(osxGraphicsPipe::get_class_type(), osxGraphicsPipe::pipe_constructor);
|
selection->add_pipe_type(osxGraphicsPipe::get_class_type(), osxGraphicsPipe::pipe_constructor);
|
||||||
|
|
||||||
|
@ -77,12 +77,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
|
|||||||
osxGraphicsStateGuardian *osxgsg;
|
osxGraphicsStateGuardian *osxgsg;
|
||||||
DCAST_INTO_R(osxgsg, _gsg, false);
|
DCAST_INTO_R(osxgsg, _gsg, false);
|
||||||
if (!aglSetPBuffer(osxgsg->get_context(), _pbuffer, 0, 0, 0)) {
|
if (!aglSetPBuffer(osxgsg->get_context(), _pbuffer, 0, 0, 0)) {
|
||||||
aglReportError("aglSetPBuffer");
|
report_agl_error("aglSetPBuffer");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!aglSetCurrentContext(osxgsg->get_context())) {
|
if (!aglSetCurrentContext(osxgsg->get_context())) {
|
||||||
aglReportError("aglSetCurrentContext");
|
report_agl_error("aglSetCurrentContext");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ open_buffer() {
|
|||||||
target = GL_TEXTURE_2D;
|
target = GL_TEXTURE_2D;
|
||||||
}
|
}
|
||||||
if (!aglCreatePBuffer(_x_size, _y_size, target, GL_RGBA, 0, &_pbuffer)) {
|
if (!aglCreatePBuffer(_x_size, _y_size, target, GL_RGBA, 0, &_pbuffer)) {
|
||||||
aglReportError("aglCreatePBuffer");
|
report_agl_error("aglCreatePBuffer");
|
||||||
close_buffer();
|
close_buffer();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -178,19 +178,20 @@ open_buffer() {
|
|||||||
|
|
||||||
osxGraphicsStateGuardian *osxgsg;
|
osxGraphicsStateGuardian *osxgsg;
|
||||||
DCAST_INTO_R(osxgsg, _gsg, false);
|
DCAST_INTO_R(osxgsg, _gsg, false);
|
||||||
OSStatus stat = osxgsg->buildGL(false, true, _fb_properties);
|
|
||||||
|
OSStatus stat = osxgsg->build_gl(false, true, _fb_properties);
|
||||||
if (stat != noErr) {
|
if (stat != noErr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!aglSetPBuffer(osxgsg->get_context(), _pbuffer, 0, 0, 0)) {
|
if (!aglSetPBuffer(osxgsg->get_context(), _pbuffer, 0, 0, 0)) {
|
||||||
aglReportError("aglSetPBuffer");
|
report_agl_error("aglSetPBuffer");
|
||||||
close_buffer();
|
close_buffer();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!aglSetCurrentContext(osxgsg->get_context())) {
|
if (!aglSetCurrentContext(osxgsg->get_context())) {
|
||||||
aglReportError("aglSetCurrentContext");
|
report_agl_error("aglSetCurrentContext");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,8 +51,7 @@ protected:
|
|||||||
int retry,
|
int retry,
|
||||||
bool &precertify);
|
bool &precertify);
|
||||||
|
|
||||||
private:
|
public:
|
||||||
public:
|
|
||||||
static TypeHandle get_class_type() {
|
static TypeHandle get_class_type() {
|
||||||
return _type_handle;
|
return _type_handle;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
TypeHandle osxGraphicsStateGuardian::_type_handle;
|
TypeHandle osxGraphicsStateGuardian::_type_handle;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: osxGraphicsStateGuardian::get_extension_func
|
// Function: osxGraphicsStateGuardian::get_extension_func
|
||||||
// Access: Public, Virtual
|
// Access: Public, Virtual
|
||||||
@ -39,20 +38,21 @@ TypeHandle osxGraphicsStateGuardian::_type_handle;
|
|||||||
// it is an error to call this for a function that is
|
// it is an error to call this for a function that is
|
||||||
// not defined.
|
// not defined.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void *osxGraphicsStateGuardian::get_extension_func(const char *prefix, const char *name)
|
void *osxGraphicsStateGuardian::
|
||||||
{
|
get_extension_func(const char *prefix, const char *name) {
|
||||||
string fullname = "_" + string(prefix) + string(name);
|
string fullname = "_" + string(prefix) + string(name);
|
||||||
NSSymbol symbol = NULL;
|
NSSymbol symbol = NULL;
|
||||||
|
|
||||||
if (NSIsSymbolNameDefined (fullname.c_str()))
|
if (NSIsSymbolNameDefined (fullname.c_str())) {
|
||||||
symbol = NSLookupAndBindSymbol (fullname.c_str());
|
symbol = NSLookupAndBindSymbol (fullname.c_str());
|
||||||
|
}
|
||||||
if (osxdisplay_cat.is_debug())
|
|
||||||
{
|
if (osxdisplay_cat.is_debug()) {
|
||||||
osxdisplay_cat.debug() << " Looking Up Symbol " << fullname <<" \n" ;
|
osxdisplay_cat.debug()
|
||||||
}
|
<< "Looking up symbol " << fullname << "\n" ;
|
||||||
|
}
|
||||||
return symbol ? NSAddressOfSymbol (symbol) : NULL;
|
|
||||||
|
return symbol ? NSAddressOfSymbol(symbol) : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -77,13 +77,12 @@ osxGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe,
|
|||||||
// Access: Public
|
// Access: Public
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
osxGraphicsStateGuardian::~osxGraphicsStateGuardian()
|
osxGraphicsStateGuardian::
|
||||||
{
|
~osxGraphicsStateGuardian() {
|
||||||
if(_aglcontext != (AGLContext)NULL)
|
if (_aglcontext != (AGLContext)NULL) {
|
||||||
{
|
aglDestroyContext(_aglcontext);
|
||||||
aglDestroyContext(_aglcontext);
|
report_agl_error("aglDestroyContext");
|
||||||
aglReportError("osxGraphicsStateGuardian::~osxGraphicsStateGuardian() aglDestroyContext");
|
_aglcontext = (AGLContext)NULL;
|
||||||
_aglcontext = (AGLContext)NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,8 +98,8 @@ void osxGraphicsStateGuardian::reset()
|
|||||||
if(_aglcontext != (AGLContext)NULL)
|
if(_aglcontext != (AGLContext)NULL)
|
||||||
{
|
{
|
||||||
aglDestroyContext(_aglcontext);
|
aglDestroyContext(_aglcontext);
|
||||||
aglReportError();
|
report_agl_error();
|
||||||
_aglcontext = (AGLContext)NULL;
|
_aglcontext = (AGLContext)NULL;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -179,20 +178,20 @@ draw_resize_box() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: osxGraphicsStateGuardian::buildGL
|
// Function: osxGraphicsStateGuardian::build_gl
|
||||||
// Access: Public, Virtual
|
// Access: Public, Virtual
|
||||||
// Description: This function will build up a context for a gsg..
|
// Description: This function will build up a context for a gsg..
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
OSStatus osxGraphicsStateGuardian::
|
OSStatus osxGraphicsStateGuardian::
|
||||||
buildGL(bool full_screen, bool pbuffer, FrameBufferProperties &fb_props) {
|
build_gl(bool full_screen, bool pbuffer, FrameBufferProperties &fb_props) {
|
||||||
if (_aglcontext) {
|
if (_aglcontext) {
|
||||||
describe_pixel_format(fb_props);
|
describe_pixel_format(fb_props);
|
||||||
return noErr; // already built
|
return noErr; // already built
|
||||||
}
|
}
|
||||||
|
|
||||||
OSStatus err = noErr;
|
OSStatus err = noErr;
|
||||||
|
|
||||||
GDHandle display = GetMainDevice ();
|
GDHandle display = GetMainDevice();
|
||||||
|
|
||||||
pvector<GLint> attrib;
|
pvector<GLint> attrib;
|
||||||
if (!fb_props.get_indexed_color()) {
|
if (!fb_props.get_indexed_color()) {
|
||||||
@ -248,14 +247,14 @@ buildGL(bool full_screen, bool pbuffer, FrameBufferProperties &fb_props) {
|
|||||||
// build context
|
// build context
|
||||||
_aglcontext = NULL;
|
_aglcontext = NULL;
|
||||||
_aglPixFmt = aglChoosePixelFormat(&display, 1, &attrib[0]);
|
_aglPixFmt = aglChoosePixelFormat(&display, 1, &attrib[0]);
|
||||||
err = aglReportError ("aglChoosePixelFormat");
|
err = report_agl_error ("aglChoosePixelFormat");
|
||||||
if (_aglPixFmt) {
|
if (_aglPixFmt) {
|
||||||
if(_share_with == NULL) {
|
if(_share_with == NULL) {
|
||||||
_aglcontext = aglCreateContext(_aglPixFmt, NULL);
|
_aglcontext = aglCreateContext(_aglPixFmt, NULL);
|
||||||
} else {
|
} else {
|
||||||
_aglcontext = aglCreateContext(_aglPixFmt, ((osxGraphicsStateGuardian *)_share_with)->_aglcontext);
|
_aglcontext = aglCreateContext(_aglPixFmt, ((osxGraphicsStateGuardian *)_share_with)->_aglcontext);
|
||||||
}
|
}
|
||||||
err = aglReportError ("aglCreateContext");
|
err = report_agl_error ("aglCreateContext");
|
||||||
|
|
||||||
if (_aglcontext == NULL) {
|
if (_aglcontext == NULL) {
|
||||||
osxdisplay_cat.error()
|
osxdisplay_cat.error()
|
||||||
@ -264,10 +263,10 @@ buildGL(bool full_screen, bool pbuffer, FrameBufferProperties &fb_props) {
|
|||||||
err = -1;
|
err = -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
aglSetInteger (_aglcontext, AGL_BUFFER_NAME, &SharedBuffer);
|
aglSetInteger (_aglcontext, AGL_BUFFER_NAME, &SharedBuffer);
|
||||||
err = aglReportError ("aglSetInteger AGL_BUFFER_NAME");
|
err = report_agl_error("aglSetInteger AGL_BUFFER_NAME");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
osxdisplay_cat.error()
|
osxdisplay_cat.error()
|
||||||
<< "osxGraphicsStateGuardian::buildG Error Getting Pixel Format\n" ;
|
<< "osxGraphicsStateGuardian::buildG Error Getting Pixel Format\n" ;
|
||||||
@ -281,10 +280,10 @@ buildGL(bool full_screen, bool pbuffer, FrameBufferProperties &fb_props) {
|
|||||||
if (err == noErr) {
|
if (err == noErr) {
|
||||||
describe_pixel_format(fb_props);
|
describe_pixel_format(fb_props);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (osxdisplay_cat.is_debug()) {
|
if (osxdisplay_cat.is_debug()) {
|
||||||
osxdisplay_cat.debug()
|
osxdisplay_cat.debug()
|
||||||
<< "osxGraphicsStateGuardian::buildGL Returning :" << err << "\n";
|
<< "osxGraphicsStateGuardian::build_gl Returning :" << err << "\n";
|
||||||
osxdisplay_cat.debug()
|
osxdisplay_cat.debug()
|
||||||
<< fb_props << "\n";
|
<< fb_props << "\n";
|
||||||
}
|
}
|
||||||
@ -383,15 +382,16 @@ describe_pixel_format(FrameBufferProperties &fb_props) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: osxGraphicsStateGuardian::get_gamma_table
|
// Function: osxGraphicsStateGuardian::get_gamma_table
|
||||||
// Access: Public, Static
|
// Access: Public, Static
|
||||||
// Description: Static function for getting the orig gamma tables
|
// Description: Static function for getting the orig gamma tables
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool osxGraphicsStateGuardian::get_gamma_table(void) {
|
bool osxGraphicsStateGuardian::
|
||||||
CGDisplayRestoreColorSyncSettings();
|
get_gamma_table() {
|
||||||
_cgErr = CGGetDisplayTransferByTable( 0, 256, _gOriginalRedTable, _gOriginalGreenTable, _gOriginalBlueTable, &_sampleCount);
|
CGDisplayRestoreColorSyncSettings();
|
||||||
|
_cgErr = CGGetDisplayTransferByTable( 0, 256, _gOriginalRedTable, _gOriginalGreenTable, _gOriginalBlueTable, &_sampleCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -402,56 +402,53 @@ bool osxGraphicsStateGuardian::get_gamma_table(void) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool osxGraphicsStateGuardian::
|
bool osxGraphicsStateGuardian::
|
||||||
static_set_gamma(bool restore, float gamma) {
|
static_set_gamma(bool restore, float gamma) {
|
||||||
bool set;
|
bool set;
|
||||||
|
|
||||||
set = false;
|
set = false;
|
||||||
|
|
||||||
if (restore) {
|
if (restore) {
|
||||||
CGDisplayRestoreColorSyncSettings();
|
CGDisplayRestoreColorSyncSettings();
|
||||||
set = true;
|
set = true;
|
||||||
return set;
|
return set;
|
||||||
}
|
}
|
||||||
// CGDisplayRestoreColorSyncSettings();
|
// CGDisplayRestoreColorSyncSettings();
|
||||||
|
|
||||||
// CGGammaValue gOriginalRedTable[ 256 ];
|
// CGGammaValue gOriginalRedTable[ 256 ];
|
||||||
// CGGammaValue gOriginalGreenTable[ 256 ];
|
// CGGammaValue gOriginalGreenTable[ 256 ];
|
||||||
// CGGammaValue gOriginalBlueTable[ 256 ];
|
// CGGammaValue gOriginalBlueTable[ 256 ];
|
||||||
|
|
||||||
// CGTableCount sampleCount;
|
// CGTableCount sampleCount;
|
||||||
// CGDisplayErr cgErr;
|
// CGDisplayErr cgErr;
|
||||||
|
|
||||||
// cgErr = CGGetDisplayTransferByTable( 0, 256, _gOriginalRedTable, _gOriginalGreenTable, _gOriginalBlueTable, &_sampleCount);
|
// cgErr = CGGetDisplayTransferByTable( 0, 256, _gOriginalRedTable, _gOriginalGreenTable, _gOriginalBlueTable, &_sampleCount);
|
||||||
|
|
||||||
CGGammaValue redTable[ 256 ];
|
CGGammaValue redTable[ 256 ];
|
||||||
CGGammaValue greenTable[ 256 ];
|
CGGammaValue greenTable[ 256 ];
|
||||||
CGGammaValue blueTable[ 256 ];
|
CGGammaValue blueTable[ 256 ];
|
||||||
|
|
||||||
short j, i;
|
short j, i;
|
||||||
short y[3];
|
short y[3];
|
||||||
|
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++) {
|
||||||
{
|
y[j] = 255;
|
||||||
y[j] = 255;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
y[0] = 256 * gamma;
|
|
||||||
y[1] = 256 * gamma;
|
|
||||||
y[2] = 256 * gamma;
|
|
||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
|
||||||
{
|
|
||||||
redTable[i] = _gOriginalRedTable[ i ] * (y[ 0 ] ) / 256;
|
|
||||||
greenTable[ i ] = _gOriginalGreenTable[ i ] * (y[ 1 ] ) / 256;
|
|
||||||
blueTable[ i ] = _gOriginalBlueTable[ i ] * (y[ 2 ] ) / 256;
|
|
||||||
};
|
|
||||||
_cgErr = CGSetDisplayTransferByTable( 0, 256, redTable, greenTable, blueTable);
|
|
||||||
|
|
||||||
if (_cgErr == 0){
|
|
||||||
set = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
y[0] = 256 * gamma;
|
||||||
|
y[1] = 256 * gamma;
|
||||||
|
y[2] = 256 * gamma;
|
||||||
|
|
||||||
|
for (i = 0; i < 256; i++) {
|
||||||
|
redTable[i] = _gOriginalRedTable[ i ] * (y[ 0 ] ) / 256;
|
||||||
|
greenTable[ i ] = _gOriginalGreenTable[ i ] * (y[ 1 ] ) / 256;
|
||||||
|
blueTable[ i ] = _gOriginalBlueTable[ i ] * (y[ 2 ] ) / 256;
|
||||||
|
}
|
||||||
|
_cgErr = CGSetDisplayTransferByTable( 0, 256, redTable, greenTable, blueTable);
|
||||||
|
|
||||||
|
if (_cgErr == 0) {
|
||||||
|
set = true;
|
||||||
|
}
|
||||||
|
|
||||||
return set;
|
return set;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -485,7 +482,7 @@ restore_gamma() {
|
|||||||
// Description: This function is passed to the atexit function.
|
// Description: This function is passed to the atexit function.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void osxGraphicsStateGuardian::
|
void osxGraphicsStateGuardian::
|
||||||
atexit_function(void) {
|
atexit_function() {
|
||||||
static_set_gamma(true, 1.0);
|
static_set_gamma(true, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,20 +40,20 @@ public:
|
|||||||
|
|
||||||
void draw_resize_box();
|
void draw_resize_box();
|
||||||
|
|
||||||
bool get_gamma_table(void);
|
bool get_gamma_table();
|
||||||
bool static_set_gamma(bool restore, float gamma);
|
bool static_set_gamma(bool restore, float gamma);
|
||||||
bool set_gamma(float gamma);
|
bool set_gamma(float gamma);
|
||||||
void atexit_function(void);
|
void atexit_function();
|
||||||
void restore_gamma();
|
void restore_gamma();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void *get_extension_func(const char *prefix, const char *name);
|
virtual void *get_extension_func(const char *prefix, const char *name);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OSStatus buildGL(bool full_screen, bool pbuffer, FrameBufferProperties &fb_props);
|
OSStatus build_gl(bool full_screen, bool pbuffer, FrameBufferProperties &fb_props);
|
||||||
AGLContext get_context(void) { return _aglcontext; };
|
AGLContext get_context(void) { return _aglcontext; };
|
||||||
|
|
||||||
const AGLPixelFormat getAGlPixelFormat() const { return _aglPixFmt; };
|
const AGLPixelFormat get_agl_pixel_format() const { return _aglPixFmt; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void describe_pixel_format(FrameBufferProperties &fb_props);
|
void describe_pixel_format(FrameBufferProperties &fb_props);
|
||||||
|
@ -13,11 +13,16 @@
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
inline void osxGraphicsWindow::SendKeyEvent( ButtonHandle key, bool down)
|
// Function: osxGraphicsWindow::send_key_event
|
||||||
{
|
// Access: Private
|
||||||
if(down)
|
// Description:
|
||||||
_input_devices[0].button_down(key);
|
////////////////////////////////////////////////////////////////////
|
||||||
else
|
inline void osxGraphicsWindow::
|
||||||
_input_devices[0].button_up(key);
|
send_key_event(ButtonHandle key, bool down) {
|
||||||
|
if (down) {
|
||||||
|
_input_devices[0].button_down(key);
|
||||||
|
} else {
|
||||||
|
_input_devices[0].button_up(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include <AGL/agl.h>
|
#include <AGL/agl.h>
|
||||||
|
|
||||||
#define HACK_SCREEN_HASH_CONTEXT true
|
#define HACK_SCREEN_HASH_CONTEXT true
|
||||||
OSStatus aglReportError (const std::string &);
|
OSStatus report_agl_error(const string &comment);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Class : osxGraphicsWindow
|
// Class : osxGraphicsWindow
|
||||||
@ -59,43 +59,42 @@ public:
|
|||||||
virtual void set_properties_now(WindowProperties &properties);
|
virtual void set_properties_now(WindowProperties &properties);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ReleaseSystemResources();
|
void release_system_resources();
|
||||||
inline void SendKeyEvent( ButtonHandle key, bool down);
|
inline void send_key_event(ButtonHandle key, bool down);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void close_window();
|
virtual void close_window();
|
||||||
virtual bool open_window();
|
virtual bool open_window();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool os_open_window(WindowProperties &properties);
|
||||||
bool OSOpenWindow(WindowProperties &properties);
|
|
||||||
|
|
||||||
//
|
|
||||||
// a singleton .. for the events to find the right pipe to push the event into
|
|
||||||
//
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// a singleton .. for the events to find the right pipe to push the event into
|
||||||
|
//
|
||||||
|
|
||||||
public: // do not call direct ..
|
public: // do not call direct ..
|
||||||
OSStatus handleKeyInput (EventHandlerCallRef myHandler, EventRef event, Boolean keyDown);
|
OSStatus handle_key_input(EventHandlerCallRef myHandler, EventRef event,
|
||||||
OSStatus handleTextInput (EventHandlerCallRef myHandler, EventRef event);
|
Boolean keyDown);
|
||||||
OSStatus handleWindowMouseEvents (EventHandlerCallRef myHandler, EventRef event);
|
OSStatus handle_text_input(EventHandlerCallRef myHandler, EventRef event);
|
||||||
ButtonHandle OSX_TranslateKey( UInt32 key, EventRef event );
|
OSStatus handle_window_mouse_events(EventHandlerCallRef myHandler, EventRef event);
|
||||||
static osxGraphicsWindow * GetCurrentOSxWindow (WindowRef hint);
|
ButtonHandle osx_translate_key(UInt32 key, EventRef event);
|
||||||
|
static osxGraphicsWindow *get_current_osx_window(WindowRef hint);
|
||||||
|
|
||||||
void HandleModifireDeleta(UInt32 modifiers);
|
void handle_modifier_delta(UInt32 new_modifiers);
|
||||||
void HandleButtonDelta(UInt32 new_buttons);
|
void handle_button_delta(UInt32 new_buttons);
|
||||||
void DoResize(void);
|
void do_resize();
|
||||||
|
|
||||||
OSStatus event_handler(EventHandlerCallRef myHandler, EventRef event);
|
OSStatus event_handler(EventHandlerCallRef myHandler, EventRef event);
|
||||||
|
|
||||||
virtual void user_close_request();
|
virtual void user_close_request();
|
||||||
void SystemCloseWindow();
|
void system_close_window();
|
||||||
void SystemSetWindowForground(bool forground);
|
void system_set_window_foreground(bool foreground);
|
||||||
void SystemPointToLocalPoint(Point &qdGlobalPoint);
|
void system_point_to_local_point(Point &global_point);
|
||||||
void LocalPointToSystemPoint(Point &qdLocalPoint);
|
void local_point_to_system_point(Point &local_point);
|
||||||
AGLContext get_ggs_context(void);
|
AGLContext get_gsg_context();
|
||||||
AGLContext get_context(void);
|
AGLContext get_context();
|
||||||
OSStatus buildGL(bool full_screen);
|
OSStatus build_gl(bool full_screen);
|
||||||
bool set_icon_filename(const Filename &icon_filename);
|
bool set_icon_filename(const Filename &icon_filename);
|
||||||
|
|
||||||
void set_pointer_in_window(int x, int y);
|
void set_pointer_in_window(int x, int y);
|
||||||
@ -111,7 +110,7 @@ private:
|
|||||||
CGImageRef _current_icon;
|
CGImageRef _current_icon;
|
||||||
|
|
||||||
int _ID;
|
int _ID;
|
||||||
static osxGraphicsWindow *FullScreenWindow;
|
static osxGraphicsWindow *full_screen_window;
|
||||||
|
|
||||||
#ifdef HACK_SCREEN_HASH_CONTEXT
|
#ifdef HACK_SCREEN_HASH_CONTEXT
|
||||||
AGLContext _holder_aglcontext;
|
AGLContext _holder_aglcontext;
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user