Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Teddy::Graphics Namespace Reference


Compounds

class  Teddy::Graphics::Color
 Color with red, green, blue and alpha components. More...

struct  Teddy::Graphics::DepthIndex
struct  Teddy::Graphics::Feedback3Dcolor
class  Teddy::Graphics::Font
 Glyph rendering with OpenGL textured quads. More...

class  Teddy::Graphics::ImageFileTexture
 Texture which is loaded from an image file. More...

class  Teddy::Graphics::PixFileTexture
 Texture which is loaded from a .PIX file, used by IWar I for example. More...

class  Teddy::Graphics::PsRenderer
class  Teddy::Graphics::Texture
 Texture. More...

class  Teddy::Graphics::TextureManager
 Texture manager. More...

class  Teddy::Graphics::View
 Root drawing device (context). More...

class  Teddy::Graphics::ViewClient
 Base class for View users. More...


Functions

Uint32 getpixel (SDL_Surface *surface, int x, int y)
int minPow (GLuint value)
 Return the minimum power of two at least as large as spesified value. More...


Variables

float DIV_256 = 1.0f/256.0f
char * NicegouraudtriangleEPS []
char * gouraudtriangleEPS []


Detailed Description

This namespace contains the lower part of graphics rendering architecture of Teddy. Other parts are in several other modules; you should at least know that PhysicalComponents module has Projection class, which is responsible for applying materials and rendering any 3D graphics.

While some parts of OpenGL have been encapsulated into View class in Graphics, there are still a lot of direct OpenGL calls all over Teddy. In the future all OpenGL should be made through encapsulated interface.


Function Documentation

Uint32 getpixel SDL_Surface *    surface,
int    x,
int    y
[static]
 

int minPow GLuint    value [static]
 

Return the minimum power of two at least as large as spesified value.

Parameters:
value  Minimum accepted result
Returns:
Smallest power of two not smaller than value

Definition at line 69 of file Texture.cpp.

Referenced by Teddy::Graphics::Texture::doSize.


Variable Documentation

float Teddy::Graphics::DIV_256 = 1.0f/256.0f [static]
 

Definition at line 51 of file Font.cpp.

Referenced by Teddy::Graphics::Font::Font.

char* Teddy::Graphics::gouraudtriangleEPS[] [static]
 

Initial value:

{
    "/bd{bind def}bind def /triangle { aload pop   setrgbcolor  aload pop 5 3",
    "roll 4 2 roll 3 2 roll exch moveto lineto lineto closepath fill } bd",
    "/computediff1 { 2 copy sub abs threshold ge {pop pop pop true} { exch 2",
    "index sub abs threshold ge { pop pop true} { sub abs threshold ge } ifelse",
    "} ifelse } bd /computediff3 { 3 copy 0 get 3 1 roll 0 get 3 1 roll 0 get",
    "computediff1 {true} { 3 copy 1 get 3 1 roll 1 get 3 1 roll 1 get",
    "computediff1 {true} { 3 copy 2 get 3 1 roll  2 get 3 1 roll 2 get",
    "computediff1 } ifelse } ifelse } bd /middlecolor { aload pop 4 -1 roll",
    "aload pop 4 -1 roll add 2 div 5 1 roll 3 -1 roll add 2 div 3 1 roll add 2",
    "div 3 1 roll exch 3 array astore } bd /gouraudtriangle { computediff3 { 4",
    "-1 roll aload 7 1 roll 6 -1 roll pop 3 -1 roll pop add 2 div 3 1 roll add",
    "2 div exch 3 -1 roll aload 7 1 roll exch pop 4 -1 roll pop add 2 div 3 1",
    "roll add 2 div exch 3 -1 roll aload 7 1 roll pop 3 -1 roll pop add 2 div 3",
    "1 roll add 2 div exch 7 3 roll 10 -3 roll dup 3 index middlecolor 4 1 roll",
    "2 copy middlecolor 4 1 roll 3 copy pop middlecolor 4 1 roll 13 -1 roll",
    "aload pop 17 index 6 index 15 index 19 index 6 index 17 index 6 array",
    "astore 10 index 10 index 14 index gouraudtriangle 17 index 5 index 17",
    "index 19 index 5 index 19 index 6 array astore 10 index 9 index 13 index",
    "gouraudtriangle 13 index 16 index 5 index 15 index 18 index 5 index 6",
    "array astore 12 index 12 index 9 index gouraudtriangle 17 index 16 index",
    "15 index 19 index 18 index 17 index 6 array astore 10 index 12 index 14",
    "index gouraudtriangle 18 {pop} repeat } { aload pop 5 3 roll aload pop 7 3",
    "roll aload pop 9 3 roll 8 index 6 index 4 index add add 3 div 10 1 roll 7",
    "index 5 index 3 index add add 3 div 10 1 roll 6 index 4 index 2 index add",
    "add 3 div 10 1 roll 9 {pop} repeat 3 array astore triangle } ifelse } bd",
    NULL
}

Definition at line 123 of file PsRenderer.cpp.

Referenced by Teddy::Graphics::PsRenderer::spewWireFrameEPS.

char* Teddy::Graphics::NicegouraudtriangleEPS[] [static]
 

Definition at line 66 of file PsRenderer.cpp.