Generic display driver for cocoa On grounds to not duplicate some code, it contains a few variables which are not used by all device drivers.
More...
#include <cocoa_v.h>
Public Member Functions |
virtual | ~CocoaSubdriver () |
| Initialize driver.
|
virtual void | Draw (bool force_update=false)=0 |
| Draw window.
|
virtual void | MakeDirty (int left, int top, int width, int height)=0 |
| Mark dirty a screen region.
|
virtual void | UpdatePalette (uint first_color, uint num_colors)=0 |
| Update the palette.
|
virtual uint | ListModes (OTTD_Point *modes, uint max_modes)=0 |
virtual bool | ChangeResolution (int w, int h, int bpp)=0 |
| Change window resolution.
|
virtual bool | IsFullscreen ()=0 |
| Are we in fullscreen mode.
|
virtual bool | ToggleFullscreen () |
| Toggle between fullscreen and windowed mode.
|
virtual int | GetWidth ()=0 |
| Return the width of the current view.
|
virtual int | GetHeight ()=0 |
| Return the height of the current view.
|
virtual void * | GetPixelBuffer ()=0 |
| Return the current pixel buffer.
|
virtual CGPoint | PrivateLocalToCG (NSPoint *p)=0 |
| Convert local coordinate to window server (CoreGraphics) coordinate.
|
virtual NSPoint | GetMouseLocation (NSEvent *event)=0 |
| Return the mouse location.
|
virtual bool | MouseIsInsideView (NSPoint *pt)=0 |
| Return whether the mouse is within our view.
|
virtual bool | IsActive ()=0 |
| Return whether the window is active (visible)
|
virtual void | SetPortAlphaOpaque () |
| Makes the game region of the window 100% opaque.
|
virtual bool | WindowResized () |
| Whether the window was successfully resized.
|
Detailed Description
Generic display driver for cocoa On grounds to not duplicate some code, it contains a few variables which are not used by all device drivers.
Definition at line 76 of file cocoa_v.h.
Member Function Documentation
virtual bool CocoaSubdriver::ChangeResolution |
( |
int |
w, |
|
|
int |
h, |
|
|
int |
bpp |
|
) |
| |
|
pure virtual |
Change window resolution.
- Parameters
-
w | New window width |
h | New window height |
- Returns
- Whether change was successful
virtual void CocoaSubdriver::Draw |
( |
bool |
force_update = false | ) |
|
|
pure virtual |
Draw window.
- Parameters
-
force_update | Whether to redraw unconditionally |
virtual int CocoaSubdriver::GetHeight |
( |
| ) |
|
|
pure virtual |
Return the height of the current view.
- Returns
- height of the current view
virtual NSPoint CocoaSubdriver::GetMouseLocation |
( |
NSEvent * |
event | ) |
|
|
pure virtual |
Return the mouse location.
- Parameters
-
- Returns
- mouse location as NSPoint
virtual void* CocoaSubdriver::GetPixelBuffer |
( |
| ) |
|
|
pure virtual |
Return the current pixel buffer.
- Returns
- pixelbuffer
virtual int CocoaSubdriver::GetWidth |
( |
| ) |
|
|
pure virtual |
Return the width of the current view.
- Returns
- width of the current view
virtual bool CocoaSubdriver::IsActive |
( |
| ) |
|
|
pure virtual |
Return whether the window is active (visible)
- Returns
- whether the window is visible or not
virtual bool CocoaSubdriver::IsFullscreen |
( |
| ) |
|
|
pure virtual |
Are we in fullscreen mode.
- Returns
- whether fullscreen mode is currently used
virtual void CocoaSubdriver::MakeDirty |
( |
int |
left, |
|
|
int |
top, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
pure virtual |
Mark dirty a screen region.
- Parameters
-
left | x-coordinate of left border |
top | y-coordinate of top border |
width | width or dirty rectangle |
height | height of dirty rectangle |
virtual bool CocoaSubdriver::MouseIsInsideView |
( |
NSPoint * |
pt | ) |
|
|
pure virtual |
Return whether the mouse is within our view.
- Parameters
-
- Returns
- Whether mouse coordinates are within view
virtual CGPoint CocoaSubdriver::PrivateLocalToCG |
( |
NSPoint * |
p | ) |
|
|
pure virtual |
Convert local coordinate to window server (CoreGraphics) coordinate.
- Parameters
-
- Returns
- window driver coordinates
virtual void CocoaSubdriver::SetPortAlphaOpaque |
( |
| ) |
|
|
inlinevirtual |
Makes the game region of the window 100% opaque.
Definition at line 183 of file cocoa_v.h.
virtual bool CocoaSubdriver::ToggleFullscreen |
( |
| ) |
|
|
inlinevirtual |
Toggle between fullscreen and windowed mode.
- Returns
- whether switch was successful
Definition at line 142 of file cocoa_v.h.
virtual bool CocoaSubdriver::WindowResized |
( |
| ) |
|
|
inlinevirtual |
Whether the window was successfully resized.
- Returns
- whether the window was successfully resized
Definition at line 188 of file cocoa_v.h.
The documentation for this class was generated from the following file: