Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions
osxGraphicsWindow Class Reference

An interface to the osx/ system for managing GL windows under X. More...

#include "osxGraphicsWindow.h"

Inheritance diagram for osxGraphicsWindow:
GraphicsWindow GraphicsOutput GraphicsOutputBase DrawableRegion TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Public Member Functions

 osxGraphicsWindow (GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host)
virtual void begin_flip ()
 This function will be called within the draw thread after end_frame() has been called on all windows, to initiate the exchange of the front and back buffers.
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.
OSStatus build_gl (bool full_screen)
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()) to change the size and/or position of the window.
void do_resize ()
virtual void end_flip ()
 This function will be called within the draw thread after begin_flip() has been called on all windows, to finish the exchange of the front and back buffers.
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.
OSStatus event_handler (EventHandlerCallRef myHandler, EventRef event)
virtual TypeHandle force_init_type ()
AGLContext get_context ()
AGLContext get_gsg_context ()
virtual TypeHandle get_type () const
void handle_button_delta (UInt32 new_buttons)
OSStatus handle_key_input (EventHandlerCallRef myHandler, EventRef event, Boolean keyDown)
void handle_modifier_delta (UInt32 new_modifiers)
OSStatus handle_text_input (EventHandlerCallRef myHandler, EventRef event)
OSStatus handle_window_mouse_events (EventHandlerCallRef myHandler, EventRef event)
void local_point_to_system_point (Point &local_point)
virtual void mouse_mode_absolute ()
 reattaches mouse to location
virtual void mouse_mode_relative ()
 detaches mouse.
virtual bool move_pointer (int device, int x, int y)
 Forces the pointer to the indicated position within the window, if possible.
ButtonHandle osx_translate_key (UInt32 key, EventRef event)
virtual void process_events ()
 Do whatever processing is necessary to ensure that the window responds to user events.
bool set_icon_filename (const Filename &icon_filename)
void set_pointer_in_window (int x, int y)
void set_pointer_out_of_window ()
virtual void set_properties_now (WindowProperties &properties)
 Applies the requested set of properties to the window, if possible, for instance to request a change in size or minimization status.
void system_close_window ()
void system_point_to_local_point (Point &global_point)
void system_set_window_foreground (bool foreground)
virtual void user_close_request ()

Static Public Member Functions

static TypeHandle get_class_type ()
static osxGraphicsWindowget_current_osx_window (WindowRef hint)
static void init_type ()

Protected Member Functions

virtual void close_window ()
 Closes the window right now.
virtual bool open_window ()
 Opens the window right now.

Detailed Description

An interface to the osx/ system for managing GL windows under X.

Definition at line 33 of file osxGraphicsWindow.h.


Member Function Documentation

virtual void osxGraphicsWindow::begin_flip ( ) [virtual]

This function will be called within the draw thread after end_frame() has been called on all windows, to initiate the exchange of the front and back buffers.

This should instruct the window to prepare for the flip at the next video sync, but it should not wait.

We have the two separate functions, begin_flip() and end_flip(), to make it easier to flip all of the windows at the same time.

Reimplemented from GraphicsOutput.

virtual bool osxGraphicsWindow::begin_frame ( FrameMode  mode,
Thread current_thread 
) [virtual]

This function will be called within the draw thread before beginning rendering for a given frame.

It should do whatever setup is required, and return true if the frame should be rendered, or false if it should be skipped.

Reimplemented from GraphicsOutput.

virtual void osxGraphicsWindow::close_window ( ) [protected, virtual]

Closes the window right now.

Called from the window thread.

Reimplemented from GraphicsWindow.

virtual bool osxGraphicsWindow::do_reshape_request ( int  x_origin,
int  y_origin,
bool  has_origin,
int  x_size,
int  y_size 
) [virtual]

Called from the window thread in response to a request from within the code (via request_properties()) to change the size and/or position of the window.

Returns true if the window is successfully changed, or false if there was a problem.

Reimplemented from GraphicsWindow.

virtual void osxGraphicsWindow::end_flip ( ) [virtual]

This function will be called within the draw thread after begin_flip() has been called on all windows, to finish the exchange of the front and back buffers.

This should cause the window to wait for the flip, if necessary.

Reimplemented from GraphicsOutput.

virtual void osxGraphicsWindow::end_frame ( FrameMode  mode,
Thread current_thread 
) [virtual]

This function will be called within the draw thread after rendering is completed for a given frame.

It should do whatever finalization is required.

Reimplemented from GraphicsOutput.

virtual void osxGraphicsWindow::mouse_mode_absolute ( ) [virtual]

reattaches mouse to location

Reimplemented from GraphicsWindow.

virtual void osxGraphicsWindow::mouse_mode_relative ( ) [virtual]

detaches mouse.

Only mouse delta from now on.

Reimplemented from GraphicsWindow.

virtual bool osxGraphicsWindow::move_pointer ( int  device,
int  x,
int  y 
) [virtual]

Forces the pointer to the indicated position within the window, if possible.

Returns true if successful, false on failure. This may fail if the mouse is not currently within the window, or if the API doesn't support this operation.

Reimplemented from GraphicsWindow.

virtual bool osxGraphicsWindow::open_window ( ) [protected, virtual]

Opens the window right now.

Called from the window thread. Returns true if the window is successfully opened, or false if there was a problem.

Reimplemented from GraphicsWindow.

virtual void osxGraphicsWindow::process_events ( ) [virtual]

Do whatever processing is necessary to ensure that the window responds to user events.

Also, honor any requests recently made via request_properties().

This function is called only within the window thread.

Reimplemented from GraphicsWindow.

virtual void osxGraphicsWindow::set_properties_now ( WindowProperties properties) [virtual]

Applies the requested set of properties to the window, if possible, for instance to request a change in size or minimization status.

The window properties are applied immediately, rather than waiting until the next frame. This implies that this method may *only* be called from within the window thread.

The properties that have been applied are cleared from the structure by this function; so on return, whatever remains in the properties structure are those that were unchanged for some reason (probably because the underlying interface does not support changing that property on an open window).

Reimplemented from GraphicsWindow.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations