12 #ifndef OSXGRAPHICSWINDOW_H 13 #define OSXGRAPHICSWINDOW_H 19 #include <Carbon/Carbon.h> 22 #include <OpenGL/gl.h> 25 #define HACK_SCREEN_HASH_CONTEXT true 26 OSStatus report_agl_error(
const std::string &comment);
34 const std::string &name,
51 int x_size,
int y_size);
59 void release_system_resources(
bool destructing);
63 virtual void close_window();
64 virtual bool open_window();
73 OSStatus handle_key_input(EventHandlerCallRef myHandler, EventRef event,
75 OSStatus handle_text_input(EventHandlerCallRef myHandler, EventRef event);
76 OSStatus handle_window_mouse_events(EventHandlerCallRef myHandler, EventRef event);
77 ButtonHandle osx_translate_key(UInt32 key, EventRef event);
80 void handle_modifier_delta(UInt32 new_modifiers);
81 void handle_button_delta(UInt32 new_buttons);
84 OSStatus event_handler(EventHandlerCallRef myHandler, EventRef event);
86 virtual void user_close_request();
87 void system_close_window();
88 void system_set_window_foreground(
bool foreground);
89 void system_point_to_local_point(Point &global_point);
90 void local_point_to_system_point(Point &local_point);
91 AGLContext get_gsg_context();
92 AGLContext get_context();
93 OSStatus build_gl(
bool full_screen);
94 bool set_icon_filename(
const Filename &icon_filename);
96 void set_pointer_in_window(
int x,
int y);
97 void set_pointer_out_of_window();
100 UInt32 _last_key_modifiers;
101 UInt32 _last_buttons;
102 WindowRef _osx_window;
105 CGImageRef _pending_icon;
106 CGImageRef _current_icon;
111 #ifdef HACK_SCREEN_HASH_CONTEXT 112 AGLContext _holder_aglcontext;
114 CFDictionaryRef _originalMode;
120 bool _display_hide_cursor;
122 SInt32 _wheel_hdelta;
123 SInt32 _wheel_vdelta;
129 static void init_type() {
130 GraphicsWindow::init_type();
132 GraphicsWindow::get_class_type());
135 return get_class_type();
137 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
virtual bool move_pointer(int device, int x, int y)
Forces the pointer to the indicated position within the window, if possible.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...