12 #ifndef OSXGRAPHICSWINDOW_H
13 #define OSXGRAPHICSWINDOW_H
15 #include "pandabase.h"
16 #include "graphicsWindow.h"
17 #include "buttonHandle.h"
19 #include <Carbon/Carbon.h>
22 #include <OpenGL/gl.h>
25 #define HACK_SCREEN_HASH_CONTEXT true
26 OSStatus report_agl_error(
const string &comment);
53 int x_size,
int y_size);
61 void release_system_resources(
bool destructing);
65 virtual void close_window();
66 virtual bool open_window();
76 OSStatus handle_key_input(EventHandlerCallRef myHandler, EventRef event,
78 OSStatus handle_text_input(EventHandlerCallRef myHandler, EventRef event);
79 OSStatus handle_window_mouse_events(EventHandlerCallRef myHandler, EventRef event);
80 ButtonHandle osx_translate_key(UInt32 key, EventRef event);
83 void handle_modifier_delta(UInt32 new_modifiers);
84 void handle_button_delta(UInt32 new_buttons);
87 OSStatus event_handler(EventHandlerCallRef myHandler, EventRef event);
89 virtual void user_close_request();
90 void system_close_window();
91 void system_set_window_foreground(
bool foreground);
92 void system_point_to_local_point(Point &global_point);
93 void local_point_to_system_point(Point &local_point);
94 AGLContext get_gsg_context();
95 AGLContext get_context();
96 OSStatus build_gl(
bool full_screen);
97 bool set_icon_filename(
const Filename &icon_filename);
99 void set_pointer_in_window(
int x,
int y);
100 void set_pointer_out_of_window();
103 UInt32 _last_key_modifiers;
104 UInt32 _last_buttons;
105 WindowRef _osx_window;
108 CGImageRef _pending_icon;
109 CGImageRef _current_icon;
114 #ifdef HACK_SCREEN_HASH_CONTEXT
115 AGLContext _holder_aglcontext;
117 CFDictionaryRef _originalMode;
123 bool _display_hide_cursor;
125 SInt32 _wheel_hdelta;
126 SInt32 _wheel_vdelta;
132 static void init_type() {
133 GraphicsWindow::init_type();
134 register_type(_type_handle,
"osxGraphicsWindow",
135 GraphicsWindow::get_class_type());
138 return get_class_type();
140 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
146 #include "osxGraphicsWindow.I"
virtual bool move_pointer(int device, int x, int y)
Forces the pointer to the indicated position within the window, if possible.
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive d...
virtual void begin_flip()
This function will be called within the draw thread after end_frame() has been called on all windows...
A container for the various kinds of properties we might ask to have on a graphics window before we o...
virtual void set_properties_now(WindowProperties &properties)
Applies the requested set of properties to the window, if possible, for instance to request a change ...
The name of a file, such as a texture file or an Egg file.
virtual void end_frame(FrameMode mode, Thread *current_thread)
This function will be called within the draw thread after rendering is completed for a given frame...
An interface to the osx/ system for managing GL windows under X.
An object to create GraphicsOutputs that share a particular 3-D API.
virtual bool begin_frame(FrameMode mode, Thread *current_thread)
This function will be called within the draw thread before beginning rendering for a given frame...
This is a base class for the various different classes that represent the result of a frame of render...
virtual void process_events()
Do whatever processing is necessary to ensure that the window responds to user events.
A thread; that is, a lightweight process.
virtual bool do_reshape_request(int x_origin, int y_origin, bool has_origin, int x_size, int y_size)
Called from the window thread in response to a request from within the code (via request_properties()...
Encapsulates all the communication with a particular instance of a given rendering backend...
This class is the main interface to controlling the render process.
virtual void mouse_mode_absolute()
reattaches mouse to location
TypeHandle is the identifier used to differentiate C++ class types.
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
virtual void mouse_mode_relative()
detaches mouse.
virtual void end_flip()
This function will be called within the draw thread after begin_flip() has been called on all windows...