Blender V2.61 - r43446
|
#include <KX_BlenderCanvas.h>
Public Member Functions | |
KX_BlenderCanvas (struct wmWindow *win, class RAS_Rect &rect, struct ARegion *ar) | |
~KX_BlenderCanvas () | |
void | Init () |
void | SwapBuffers () |
probably needs some arguments for PS2 in future | |
void | Resize (int width, int height) |
void | BeginFrame () |
void | EndFrame () |
void | ClearColor (float r, float g, float b, float a) |
void | ClearBuffer (int type) |
int | GetWidth () const |
int | GetHeight () const |
int | GetMouseX (int x) |
int | GetMouseY (int y) |
float | GetMouseNormalizedX (int x) |
float | GetMouseNormalizedY (int y) |
const RAS_Rect & | GetDisplayArea () const |
void | SetDisplayArea (RAS_Rect *rect) |
RAS_Rect & | GetWindowArea () |
void | SetViewPort (int x1, int y1, int x2, int y2) |
void | SetMouseState (RAS_MouseState mousestate) |
void | SetMousePosition (int x, int y) |
void | MakeScreenShot (const char *filename) |
bool | BeginDraw () |
void | EndDraw () |
2D Blender device context abstraction. The connection from 3d rendercontext to 2d Blender surface embedding.
Definition at line 58 of file KX_BlenderCanvas.h.
KX_BlenderCanvas::KX_BlenderCanvas | ( | struct wmWindow * | win, |
class RAS_Rect & | rect, | ||
struct ARegion * | ar | ||
) |
Definition at line 38 of file KX_BlenderCanvas.cpp.
References ARegion::winrct, rcti::xmin, and rcti::ymax.
KX_BlenderCanvas::~KX_BlenderCanvas | ( | ) |
Definition at line 47 of file KX_BlenderCanvas.cpp.
bool KX_BlenderCanvas::BeginDraw | ( | ) | [inline, virtual] |
Nothing needs be done for BlenderCanvas Begin/End Draw, as the game engine GL context is always current/active.
Implements RAS_ICanvas.
Definition at line 177 of file KX_BlenderCanvas.h.
void KX_BlenderCanvas::BeginFrame | ( | ) | [virtual] |
Implements RAS_ICanvas.
Definition at line 62 of file KX_BlenderCanvas.cpp.
void KX_BlenderCanvas::ClearBuffer | ( | int | type | ) | [virtual] |
Implements RAS_ICanvas.
Definition at line 88 of file KX_BlenderCanvas.cpp.
References RAS_ICanvas::COLOR_BUFFER, and RAS_ICanvas::DEPTH_BUFFER.
void KX_BlenderCanvas::ClearColor | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) | [virtual] |
Implements RAS_ICanvas.
Definition at line 81 of file KX_BlenderCanvas.cpp.
void KX_BlenderCanvas::EndDraw | ( | ) | [inline, virtual] |
Unitializes the canvas for drawing.
Implements RAS_ICanvas.
Definition at line 183 of file KX_BlenderCanvas.h.
void KX_BlenderCanvas::EndFrame | ( | ) | [virtual] |
Implements RAS_ICanvas.
Definition at line 70 of file KX_BlenderCanvas.cpp.
const RAS_Rect& KX_BlenderCanvas::GetDisplayArea | ( | ) | const [inline, virtual] |
Implements RAS_ICanvas.
Definition at line 133 of file KX_BlenderCanvas.h.
int KX_BlenderCanvas::GetHeight | ( | ) | const [virtual] |
Implements RAS_ICanvas.
Definition at line 105 of file KX_BlenderCanvas.cpp.
References RAS_Rect::GetHeight().
Referenced by GetMouseNormalizedY().
float KX_BlenderCanvas::GetMouseNormalizedX | ( | int | x | ) | [virtual] |
Implements RAS_ICanvas.
Definition at line 122 of file KX_BlenderCanvas.cpp.
References GetMouseX(), and GetWidth().
float KX_BlenderCanvas::GetMouseNormalizedY | ( | int | y | ) | [virtual] |
Implements RAS_ICanvas.
Definition at line 128 of file KX_BlenderCanvas.cpp.
References GetHeight(), and GetMouseY().
int KX_BlenderCanvas::GetMouseX | ( | int | x | ) | [virtual] |
Implements RAS_ICanvas.
Definition at line 110 of file KX_BlenderCanvas.cpp.
References RAS_Rect::GetLeft(), GetWindowArea(), and left().
Referenced by GetMouseNormalizedX().
int KX_BlenderCanvas::GetMouseY | ( | int | y | ) | [virtual] |
Implements RAS_ICanvas.
Definition at line 116 of file KX_BlenderCanvas.cpp.
References RAS_Rect::GetTop(), and GetWindowArea().
Referenced by GetMouseNormalizedY().
int KX_BlenderCanvas::GetWidth | ( | ) | const [virtual] |
Implements RAS_ICanvas.
Definition at line 100 of file KX_BlenderCanvas.cpp.
References RAS_Rect::GetWidth().
Referenced by GetMouseNormalizedX().
RAS_Rect & KX_BlenderCanvas::GetWindowArea | ( | ) | [virtual] |
Used to get canvas area within blender.
Implements RAS_ICanvas.
Definition at line 136 of file KX_BlenderCanvas.cpp.
Referenced by GetMouseX(), and GetMouseY().
void KX_BlenderCanvas::Init | ( | void | ) | [virtual] |
Implements RAS_ICanvas.
Definition at line 51 of file KX_BlenderCanvas.cpp.
void KX_BlenderCanvas::MakeScreenShot | ( | const char * | filename | ) | [virtual] |
Implements RAS_ICanvas.
Definition at line 208 of file KX_BlenderCanvas.cpp.
References BL_MakeScreenShot(), RAS_Rect::GetBottom(), RAS_Rect::GetLeft(), RAS_Rect::GetRight(), RAS_Rect::GetTop(), ScrArea::totrct, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
void KX_BlenderCanvas::Resize | ( | int | width, |
int | height | ||
) |
void KX_BlenderCanvas::SetDisplayArea | ( | RAS_Rect * | rect | ) | [inline, virtual] |
Implements RAS_ICanvas.
Definition at line 139 of file KX_BlenderCanvas.h.
void KX_BlenderCanvas::SetMousePosition | ( | int | x, |
int | y | ||
) | [virtual] |
Implements RAS_ICanvas.
Definition at line 197 of file KX_BlenderCanvas.cpp.
References BL_warp_pointer(), RAS_Rect::GetBottom(), RAS_Rect::GetHeight(), and RAS_Rect::GetLeft().
void KX_BlenderCanvas::SetMouseState | ( | RAS_MouseState | mousestate | ) | [virtual] |
Implements RAS_ICanvas.
Definition at line 167 of file KX_BlenderCanvas.cpp.
References BL_HideMouse(), BL_NormalMouse(), BL_WaitMouse(), RAS_ICanvas::m_mousestate, RAS_ICanvas::MOUSE_INVISIBLE, RAS_ICanvas::MOUSE_NORMAL, and RAS_ICanvas::MOUSE_WAIT.
void KX_BlenderCanvas::SetViewPort | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 | ||
) | [virtual] |
Set the visible vieport
Implements RAS_ICanvas.
Definition at line 143 of file KX_BlenderCanvas.cpp.
References RAS_Rect::GetBottom(), RAS_Rect::GetLeft(), RAS_Rect::SetBottom(), RAS_Rect::SetLeft(), RAS_Rect::SetRight(), and RAS_Rect::SetTop().
void KX_BlenderCanvas::SwapBuffers | ( | ) | [virtual] |
probably needs some arguments for PS2 in future
Implements RAS_ICanvas.
Definition at line 57 of file KX_BlenderCanvas.cpp.
References BL_SwapBuffers().