#include <View.h>
Collaboration diagram for Teddy::Graphics::View:
Public Methods | |
View (int width, int height, Teddy::MixIn::Options options) | |
View constructor. More... | |
void | reshape (int w, int h) |
Surface reshape callback function. More... | |
void | display () |
Displaying surface. More... | |
void | displayPs (char *filename) |
Displaying surface. More... | |
const Teddy::Maths::TVector2< int > & | getSize () const |
float | getRatio () |
Return aspect ratio of View. More... | |
int | getFrames () |
float | getLastFrame () |
float | getFps () |
float | getFpsTime () |
float | getLastTime () |
void | setWindowManager (Teddy::PhysicalComponents::WindowManager *wm) |
Teddy::Maths::Matrix | getOrthoMatrix (float left, float right, float bottom, float top, float nearval, float farval) |
void | setProjectionMatrix () |
Set projection matrix to identity. More... | |
void | setProjectionMatrix (const Teddy::Maths::Matrix &m) |
void | setModelViewMatrix () |
Set modelview matrix to identity. More... | |
void | setModelViewMatrix (const Teddy::Maths::Matrix &m) |
void | setTextureMatrix (const Teddy::Maths::Matrix &m) |
void | setTexture (Texture *t) |
void | setCull (unsigned long dir) |
void | beginPoints () |
void | beginLines () |
void | beginLineStrip () |
void | beginLineLoop () |
void | beginTriangles () |
void | beginTriangleStrip () |
void | beginTriangleFan () |
void | beginQuads () |
void | beginQuadStrip () |
void | beginPolygon () |
void | end () |
void | vertex (const Teddy::Maths::TVector< float > &v, const Teddy::Maths::TVector2< float > &t) const |
void | vertex (const Teddy::Maths::TVector2< float > &v, const Teddy::Maths::TVector2< float > &t) const |
void | vertex (const float x, const float y) const |
void | vertex (const Teddy::Maths::TVector< int > &v) const |
void | vertex (const Teddy::Maths::TVector< float > &v) const |
void | vertex (const Teddy::Maths::TVector< double > &v) const |
void | vertex (const Teddy::Maths::TVector2< int > &v) const |
void | vertex (const Teddy::Maths::TVector2< float > &v) const |
void | vertex (const Teddy::Maths::TVector2< double > &v) const |
void | normal (const Teddy::Maths::TVector< int > &n) const |
void | normal (const Teddy::Maths::TVector< float > &n) const |
void | normal (const Teddy::Maths::TVector< double > &n) const |
void | normal (const Teddy::Maths::TVector2< int > &n) const |
void | normal (const Teddy::Maths::TVector2< float > &n) const |
void | normal (const Teddy::Maths::TVector2< double > &n) const |
void | texture (const Teddy::Maths::TVector< int > &t) const |
void | texture (const Teddy::Maths::TVector< float > &t) const |
void | texture (const Teddy::Maths::TVector< double > &t) const |
void | texture (const Teddy::Maths::TVector2< int > &t) const |
void | texture (const Teddy::Maths::TVector2< float > &t) const |
void | texture (const Teddy::Maths::TVector2< double > &t) const |
void | color (const float r, const float g, const float b, const float a=1) const |
void | color (const Color &c) const |
void | begin2d () |
View interface - Prepare Area for rendering 2D graphics. More... | |
void | end2d () |
View interface - End rendering 2D graphics. More... | |
void | printExtensions () |
bool | hasExtension (const char *ext_name) |
Is the extension supported? More... | |
char * | getExtensions () |
char * | getVendor () |
char * | getRenderer () |
char * | getVersion () |
int | getMaxTextureSize () |
int | getMaxLights () |
Teddy::Maths::TVector< int > | getMaxViewportDims () |
void | drawString (const Teddy::Maths::TVector2< float > &pos, const char *str, Font *font) |
void | drawRect (const float x1, const float y1, const float x2, const float y2) |
Area Graphics interface - Draw non-filled rectangle - changed polygonmode.. More... | |
void | drawFillRect (const float x1, const float y1, const float x2, const float y2) |
Area Graphics interface - Draw filled rectangle - changed polygonmode.. More... | |
void | drawBiColRect (const float x1, const float y1, const float x2, const float y2, const Color &top_left, const Color &bottom_right) |
Area Graphics interface - Draw twocolor rectangle. More... | |
void | blit (const Teddy::Maths::TVector2< float > &pos, Texture *t) |
void | setClear (bool clear) |
void | setClearColor (const Color &clear_color) |
bool | getClear () |
Return clear status. More... | |
void | begin3d () |
View interface - Prepare Area for rendering 3D graphics. More... | |
void | end3d () |
View interface - End rendering 3D graphics. More... | |
void | setState (const int feature, const bool state) |
Return viewport. More... | |
bool | getState (const int feature) |
void | enable (const int feature) |
Enable OpenGL feature - only if not already enabled. More... | |
void | disable (const int feature) |
Disable OpenGL feature - only if not already disabled. More... | |
void | setPolygonMode (const unsigned int polygon_mode) |
Set gl polygon mode. More... | |
void | setShadeModel (const unsigned int shade_model) |
Set gl shade model. More... | |
void | setFrontFace (const unsigned int front_face) |
void | setBlendFunc (const unsigned int sfactor, const unsigned int dfactor) |
Set blending function. More... | |
void | setClearDepth (const float depth) |
void | setFogStart (const float start) |
Set fog start. More... | |
void | setFogEnd (const float end) |
Set fog end. More... | |
void | setFogMode (const unsigned int mode) |
Set fog mode. More... | |
void | setFogColor (float *color) |
Set fog color. More... | |
int | getScreenWidth () |
int | getScreenHeight () |
bool | pngScreenshot (char *filename) |
SDL_Surface * | getSurface () |
Access sdl surface directly. More... | |
Teddy::MixIn::Options & | getOptions () |
Static Public Methods | |
void | init () |
Initialize graphics device feature mapping. More... | |
char * | feature_to_str (int a) |
Return description for graphics feature. More... | |
unsigned int | getCode (unsigned int a) |
void | check () |
Check if there are any OpenGL errors. More... | |
Static Public Attributes | |
const int | OPT_FRAME = (1ul<<1ul) |
const int | OPT_FULLSCREEN = (1ul<<2ul) |
const int | OPT_MULTI_WINDOW = (1ul<<3ul) |
const int | OPT_SEPARATE_SPECULAR_COLOR = (1ul<<4ul) |
const int | OPT_FONT_FIX = (1ul<<5ul) |
const unsigned long | CULL_FACE = 1 |
const unsigned long | BLEND = 2 |
const unsigned long | FOG = 3 |
const unsigned long | NORMALIZE = 4 |
const unsigned long | ALPHA_TEST = 5 |
const unsigned long | DEPTH_TEST = 6 |
const unsigned long | STENCIL_TEST = 7 |
const unsigned long | SCISSOR_TEST = 8 |
const unsigned long | TEXTURE_1D = 9 |
const unsigned long | TEXTURE_2D = 10 |
const unsigned long | POINT_SMOOTH = 11 |
const unsigned long | LINE_SMOOTH = 12 |
const unsigned long | POLYGON_SMOOTH = 13 |
const unsigned long | POINT_OFFSET = 14 |
const unsigned long | LINE_OFFSET = 15 |
const unsigned long | POLYGON_OFFSET = 16 |
const unsigned long | LIGHTING = 19 |
const unsigned long | LIGHT0 = 20 |
const unsigned long | LIGHT1 = 21 |
const unsigned long | LIGHT2 = 22 |
const unsigned long | LIGHT3 = 23 |
const unsigned long | LIGHT4 = 24 |
const unsigned long | LIGHT5 = 25 |
const unsigned long | LIGHT6 = 26 |
const unsigned long | LIGHT7 = 27 |
const unsigned long | COLOR_MATERIAL = 28 |
Static Protected Methods | |
void | displayOne () |
View::display() calls active->display();. More... | |
void | reshapeOne (int w, int h) |
Protected Attributes | |
Teddy::MixIn::Options | options |
SDL_Surface * | sdl_surface |
Teddy::PhysicalComponents::WindowManager * | window_manager |
Texture * | current_texture |
Teddy::Maths::TVector2< int > | size |
int | current_element |
int | current_matrix_mode |
float | ratio |
bool | clear |
Color | clear_color |
unsigned int | gl_blend_source_factor |
unsigned int | gl_blend_destination_factor |
unsigned int | gl_fog_mode |
unsigned int | gl_polygon_mode |
unsigned int | gl_shade_model |
float | gl_fog_start |
float | gl_fog_end |
float | gl_fog_color [4] |
float | gl_clear_depth |
bool | gl_feature [256] |
int | frames |
unsigned long | last_frame |
unsigned long | last_time |
unsigned long | last_fps |
float | fps |
int | screen_width |
int | screen_height |
Static Protected Attributes | |
View * | active = NULL |
FILE * | fp |
For png screenshot writer. More... | |
Static Private Attributes | |
unsigned int | feature_to_code [256] |
View is a low level graphics device. A View must be created before any graphics related functions can be used.
Definition at line 65 of file View.h.
|
|
View interface - Prepare Area for rendering 2D graphics.
Definition at line 567 of file View.cpp. References BLEND, C_WHITE, check, color, CULL_FACE, DEPTH_TEST, disable, getOrthoMatrix, LIGHTING, setModelViewMatrix, setPolygonMode, setProjectionMatrix, and size. |
|
View interface - Prepare Area for rendering 3D graphics.
|
|
Definition at line 66 of file ViewGL.cpp. References current_element, Teddy::SysSupport::M_GL, and Teddy::SysSupport::msg. |
|
Definition at line 48 of file ViewGL.cpp. References current_element, Teddy::SysSupport::M_GL, and Teddy::SysSupport::msg. |
|
Definition at line 57 of file ViewGL.cpp. References current_element, Teddy::SysSupport::M_GL, and Teddy::SysSupport::msg. Referenced by drawBiColRect. |
|
Definition at line 39 of file ViewGL.cpp. References current_element, Teddy::SysSupport::M_GL, and Teddy::SysSupport::msg. |
|
Definition at line 119 of file ViewGL.cpp. References current_element, Teddy::SysSupport::M_GL, and Teddy::SysSupport::msg. |
|
Definition at line 101 of file ViewGL.cpp. References current_element, Teddy::SysSupport::M_GL, and Teddy::SysSupport::msg. Referenced by drawFillRect, and drawRect. |
|
Definition at line 110 of file ViewGL.cpp. References current_element, Teddy::SysSupport::M_GL, and Teddy::SysSupport::msg. |
|
Definition at line 92 of file ViewGL.cpp. References current_element, Teddy::SysSupport::M_GL, and Teddy::SysSupport::msg. |
|
Definition at line 74 of file ViewGL.cpp. References current_element, Teddy::SysSupport::M_GL, and Teddy::SysSupport::msg. |
|
Definition at line 83 of file ViewGL.cpp. References current_element, Teddy::SysSupport::M_GL, and Teddy::SysSupport::msg. |
|
|
|
Check if there are any OpenGL errors.
Definition at line 684 of file View.cpp. References Teddy::SysSupport::emsg, and Teddy::SysSupport::M_GL. |
|
Definition at line 191 of file ViewGL.cpp. |
|
Definition at line 186 of file ViewGL.cpp. Referenced by begin2d, drawBiColRect, and setFogColor. |
|
Disable OpenGL feature - only if not already disabled.
Definition at line 506 of file View.cpp. References Teddy::SysSupport::dmsg, feature_to_str, getCode, gl_feature, and Teddy::SysSupport::M_GL. |
|
Displaying surface.
Definition at line 87 of file View.cpp. References clear, clear_color, current_texture, Teddy::PhysicalComponents::WindowManager::draw, fps, frames, last_fps, last_frame, last_time, and window_manager. |
|
View::display() calls active->display();.
Definition at line 380 of file View.cpp. References active. Referenced by reshape. |
|
Displaying surface.
Definition at line 61 of file View.cpp. References clear, clear_color, current_texture, Teddy::PhysicalComponents::WindowManager::draw, and window_manager. |
|
Area Graphics interface - Draw twocolor rectangle.
Definition at line 114 of file ViewDraw.cpp. References beginLineStrip, color, end, and vertex. |
|
Area Graphics interface - Draw filled rectangle - changed polygonmode..
Definition at line 67 of file ViewDraw.cpp. References beginQuads, end, Teddy::SysSupport::M_GL, Teddy::SysSupport::msg, setPolygonMode, and vertex. |
|
Area Graphics interface - Draw non-filled rectangle - changed polygonmode..
Definition at line 102 of file ViewDraw.cpp. References beginQuads, end, setPolygonMode, and vertex. |
|
|
|
Enable OpenGL feature - only if not already enabled.
Definition at line 495 of file View.cpp. References Teddy::SysSupport::dmsg, feature_to_str, getCode, gl_feature, and Teddy::SysSupport::M_GL. Referenced by setState. |
|
Definition at line 128 of file ViewGL.cpp. References current_element, Teddy::SysSupport::M_GL, and Teddy::SysSupport::msg. Referenced by drawBiColRect, drawFillRect, drawRect, hasExtension, and setFogEnd. |
|
View interface - End rendering 2D graphics.
|
|
View interface - End rendering 3D graphics.
|
|
Return description for graphics feature.
Definition at line 104 of file ViewFeatures.cpp. References ALPHA_TEST, BLEND, COLOR_MATERIAL, CULL_FACE, DEPTH_TEST, FOG, LIGHT0, LIGHT1, LIGHT2, LIGHT3, LIGHT4, LIGHT5, LIGHT6, LIGHT7, LIGHTING, LINE_OFFSET, LINE_SMOOTH, NORMALIZE, POINT_OFFSET, POINT_SMOOTH, POLYGON_OFFSET, POLYGON_SMOOTH, SCISSOR_TEST, STENCIL_TEST, TEXTURE_1D, and TEXTURE_2D. |
|
Return clear status.
Definition at line 449 of file View.cpp. References clear. |
|
Definition at line 98 of file ViewFeatures.cpp. References feature_to_code. |
|
Definition at line 369 of file ViewGL.cpp. Referenced by hasExtension, and View. |
|
Definition at line 403 of file View.cpp. References fps. |
|
|
|
Definition at line 393 of file View.cpp. References frames. |
|
Definition at line 398 of file View.cpp. References last_frame. |
|
Definition at line 408 of file View.cpp. References last_time. |
|
Definition at line 417 of file ViewGL.cpp. |
|
Definition at line 410 of file ViewGL.cpp. |
|
|
|
Definition at line 214 of file View.h. References options. |
|
Definition at line 540 of file View.cpp. Referenced by begin2d. |
|
Return aspect ratio of View.
Definition at line 389 of file View.cpp. References ratio. |
|
Definition at line 388 of file ViewGL.cpp. Referenced by View. |
|
Definition at line 418 of file View.cpp. References screen_height. |
|
Definition at line 413 of file View.cpp. References screen_width. |
|
Definition at line 529 of file View.cpp. References Teddy::SysSupport::dmsg, Teddy::SysSupport::M_WM, and size. |
|
Definition at line 454 of file View.cpp. References Teddy::SysSupport::dmsg, feature_to_str, getCode, gl_feature, and Teddy::SysSupport::M_GL. |
|
Access sdl surface directly.
Definition at line 704 of file View.cpp. References sdl_surface. |
|
Definition at line 379 of file ViewGL.cpp. Referenced by View. |
|
Definition at line 399 of file ViewGL.cpp. Referenced by View. |
|
Is the extension supported?
Definition at line 713 of file View.cpp. References end, and getExtensions. Referenced by View. |
|
Initialize graphics device feature mapping.
Definition at line 67 of file ViewFeatures.cpp. References ALPHA_TEST, BLEND, COLOR_MATERIAL, CULL_FACE, DEPTH_TEST, Teddy::SysSupport::dmsg, feature_to_code, FOG, LIGHT0, LIGHT1, LIGHT2, LIGHT3, LIGHT4, LIGHT5, LIGHT6, LIGHT7, LIGHTING, LINE_OFFSET, LINE_SMOOTH, Teddy::SysSupport::M_INIT, NORMALIZE, POINT_OFFSET, POINT_SMOOTH, POLYGON_OFFSET, POLYGON_SMOOTH, SCISSOR_TEST, STENCIL_TEST, TEXTURE_1D, and TEXTURE_2D. Referenced by Teddy::Application::BaseRoot::start. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 70 of file ViewScreenshot.cpp. |
|
|
|
Surface reshape callback function.
Definition at line 519 of file View.cpp. References displayOne, ratio, size, Teddy::PhysicalComponents::WindowManager::update, Vector2, and window_manager. |
|
|
|
Set blending function.
Definition at line 632 of file View.cpp. References gl_blend_destination_factor, and gl_blend_source_factor. Referenced by View. |
|
Set clear status. If clear status is true, each frame is cleared before the components are drawn. Otherwise it is not cleared. Definition at line 443 of file View.cpp. References clear. |
|
Definition at line 130 of file View.cpp. References clear_color. |
|
|
|
Definition at line 135 of file View.cpp. References Teddy::SysSupport::M_INIT, and Teddy::SysSupport::msg. Referenced by View. |
|
Set fog color.
Definition at line 657 of file View.cpp. References color. |
|
Set fog end.
Definition at line 676 of file View.cpp. References end. |
|
Set fog mode.
Definition at line 646 of file View.cpp. References gl_fog_mode. |
|
Set fog start.
Definition at line 665 of file View.cpp. References gl_fog_start. |
|
|
|
|
|
Set modelview matrix to identity.
Definition at line 158 of file ViewGL.cpp. References current_matrix_mode. Referenced by begin2d. |
|
Set gl polygon mode.
Definition at line 601 of file View.cpp. References Teddy::SysSupport::dmsg, gl_polygon_mode, and Teddy::SysSupport::M_GL. Referenced by begin2d, drawFillRect, and drawRect. |
|
|
|
Set projection matrix to identity.
Definition at line 137 of file ViewGL.cpp. References current_matrix_mode. Referenced by begin2d. |
|
Set gl shade model.
Definition at line 623 of file View.cpp. References gl_shade_model. |
|
Return viewport.
|
|
Definition at line 433 of file ViewGL.cpp. References current_texture. |
|
|
|
Definition at line 535 of file View.cpp. References window_manager. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 196 of file ViewGL.cpp. |
|
|
|
Referenced by drawBiColRect, drawFillRect, and drawRect. |
|
Definition at line 50 of file View.cpp. Referenced by displayOne, and View. |
|
Definition at line 39 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 36 of file ViewFeatures.cpp. Referenced by begin2d, feature_to_str, and init. |
|
Definition at line 231 of file View.h. Referenced by display, displayPs, getClear, setClear, and View. |
|
Definition at line 232 of file View.h. Referenced by display, displayPs, setClearColor, and View. |
|
Definition at line 60 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 35 of file ViewFeatures.cpp. Referenced by begin2d, feature_to_str, and init. |
|
Definition at line 228 of file View.h. Referenced by beginLineLoop, beginLines, beginLineStrip, beginPoints, beginPolygon, beginQuads, beginQuadStrip, beginTriangleFan, beginTriangles, beginTriangleStrip, end, and View. |
|
Definition at line 229 of file View.h. Referenced by setModelViewMatrix, setProjectionMatrix, and View. |
|
Definition at line 226 of file View.h. Referenced by display, displayPs, setTexture, and View. |
|
Definition at line 40 of file ViewFeatures.cpp. Referenced by begin2d, feature_to_str, and init. |
|
Definition at line 63 of file ViewFeatures.cpp. |
|
Definition at line 37 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
For png screenshot writer.
Definition at line 253 of file View.h. Referenced by pngScreenshot. |
|
|
|
|
|
Definition at line 234 of file View.h. Referenced by setBlendFunc, and View. |
|
Definition at line 233 of file View.h. Referenced by setBlendFunc, and View. |
|
Definition at line 241 of file View.h. Referenced by View. |
|
|
|
Definition at line 240 of file View.h. Referenced by View. |
|
Definition at line 239 of file View.h. Referenced by View. |
|
Definition at line 235 of file View.h. Referenced by setFogMode, and View. |
|
Definition at line 238 of file View.h. Referenced by setFogStart, and View. |
|
Definition at line 236 of file View.h. Referenced by setPolygonMode, and View. |
|
Definition at line 237 of file View.h. Referenced by setShadeModel, and View. |
|
|
|
Definition at line 244 of file View.h. Referenced by display, getLastFrame, and View. |
|
Definition at line 245 of file View.h. Referenced by display, getLastTime, and View. |
|
Definition at line 52 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 53 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 54 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 55 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 56 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 57 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 58 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 59 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 51 of file ViewFeatures.cpp. Referenced by begin2d, feature_to_str, and init. |
|
Definition at line 49 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 46 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 38 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 57 of file View.cpp. Referenced by View. |
|
Definition at line 53 of file View.cpp. Referenced by View. |
|
Definition at line 54 of file View.cpp. Referenced by View. |
|
|
|
Definition at line 56 of file View.cpp. Referenced by View. |
|
Definition at line 223 of file View.h. Referenced by getOptions, and View. |
|
Definition at line 48 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 45 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 50 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 47 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
|
|
Definition at line 42 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 249 of file View.h. Referenced by getScreenHeight, and View. |
|
Definition at line 248 of file View.h. Referenced by getScreenWidth, and View. |
|
Definition at line 224 of file View.h. Referenced by getSurface, and View. |
|
Definition at line 227 of file View.h. Referenced by begin2d, getSize, pngScreenshot, reshape, and View. |
|
Definition at line 41 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 43 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 44 of file ViewFeatures.cpp. Referenced by feature_to_str, and init. |
|
Definition at line 225 of file View.h. Referenced by display, displayPs, reshape, and setWindowManager. |