omegalib  13.1
omega::DrawInterface Class Reference

#include <DrawInterface.h>

Public Types

enum  FlipFlags { FlipX = 1 << 1, FlipY = 1 << 2 }
 
enum  ShaderType { VertexShader, FragmentShader }
 
enum  FTGLFontType {
  FTGLBitmap, FTGLBuffer, FTGLExtrd, FTGLOutline,
  FTGLPixmap, FTGLPolygon, FTGLTexture
}
 

Public Member Functions

 DrawInterface ()
 
void setScissor (const Rect &rect)
 
Rect getScissor ()
 
GLuint makeShaderFromSource (const char *source, ShaderType Type)
 Shaders. More...
 
GLuint createProgram (GLuint vertextShader, GLuint fragmentShader)
 
GLuint getOrCreateProgram (const String &name, const String &vertexShaderFile, const String &fragmentShaderFile)
 Returns a gpu program by name. More...
 
GLuint getOrCreateProgramFromSource (const String &name, const String &vertexShaderSource, const String &fragmentShaderSource)
 Returns a gpu program by name. More...
 
GLuint findUniform (GLuint program, const String &name)
 Uniforms. More...
 
void uniformFloat (GLuint uniform, float value)
 
void beginDraw3D (const DrawContext &context)
 Drawing control. More...
 
void beginDraw2D (const DrawContext &context)
 
void endDraw ()
 
bool isDrawing ()
 
void pushTransform (const AffineTransform3 &transform)
 
void popTransform ()
 
FontcreateFont (omega::String fontName, omega::String filename, int size, FTGLFontType type=FTGLTexture)
 Font management. More...
 
FontgetFont (omega::String fontName, FTGLFontType type=FTGLTexture)
 
FontgetDefaultFont ()
 
void setDefaultFont (Font *value)
 
void setColor (const Color &col)
 New drawing API. More...
 
void fillTexture (TextureSource *texture)
 
void textureFlip (uint flipflags)
 
void textureRegion (float su, float sv, float eu, float ev)
 
void rect (float x, float y, float width, float height)
 
void program (GLuint id)
 Loads shader program with the specified id. More...
 
void drawRectGradient (Vector2f pos, Vector2f size, Orientation orientation, Color startColor, Color endColor, float pc=0.5f)
 Old drawing API. More...
 
void drawRect (Vector2f pos, Vector2f size, Color color)
 
void drawRectOutline (Vector2f pos, Vector2f size, Color color)
 
void drawText (const String &text, Font *font, const Vector2f &position, unsigned int align, Color color)
 
void drawWText (const std::wstring &text, Font *font, const Vector2f &position, unsigned int align, Color color)
 
void drawRectTexture (Texture *texture, const Vector2f &position, const Vector2f size, uint flipFlags=0, const Vector2f &minUV=Vector2f::Zero(), const Vector2f &maxUV=Vector2f::Ones())
 
void drawCircleOutline (Vector2f position, float radius, const Color &color, int segments)
 
void drawCircle (Vector2f position, float radius, const Color &color, int segments)
 
void drawWireSphere (const Color &color, int segments, int slices)
 
- Public Member Functions inherited from omicron::ReferenceType
 ReferenceType ()
 
virtual ~ReferenceType ()
 
void ref ()
 
void unref ()
 
long refCount ()
 

Additional Inherited Members

- Static Public Member Functions inherited from omicron::ReferenceType
static void printObjCounts ()
 
- Static Protected Attributes inherited from omicron::ReferenceType
static List< ReferenceType * > mysObjList
 
+ Inheritance diagram for omega::DrawInterface:

Member Enumeration Documentation

Enumerator
FlipX 
FlipY 
Enumerator
FTGLBitmap 
FTGLBuffer 
FTGLExtrd 
FTGLOutline 
FTGLPixmap 
FTGLPolygon 
FTGLTexture 
Enumerator
VertexShader 
FragmentShader 

Constructor & Destructor Documentation

omega::DrawInterface::DrawInterface ( )

Member Function Documentation

void omega::DrawInterface::beginDraw2D ( const DrawContext context)
void omega::DrawInterface::beginDraw3D ( const DrawContext context)

Drawing control.

Font* omega::DrawInterface::createFont ( omega::String  fontName,
omega::String  filename,
int  size,
FTGLFontType  type = FTGLTexture 
)

Font management.

GLuint omega::DrawInterface::createProgram ( GLuint  vertextShader,
GLuint  fragmentShader 
)
void omega::DrawInterface::drawCircle ( Vector2f  position,
float  radius,
const Color color,
int  segments 
)
void omega::DrawInterface::drawCircleOutline ( Vector2f  position,
float  radius,
const Color color,
int  segments 
)
void omega::DrawInterface::drawRect ( Vector2f  pos,
Vector2f  size,
Color  color 
)
void omega::DrawInterface::drawRectGradient ( Vector2f  pos,
Vector2f  size,
Orientation  orientation,
Color  startColor,
Color  endColor,
float  pc = 0.5f 
)

Old drawing API.

void omega::DrawInterface::drawRectOutline ( Vector2f  pos,
Vector2f  size,
Color  color 
)
void omega::DrawInterface::drawRectTexture ( Texture texture,
const Vector2f position,
const Vector2f  size,
uint  flipFlags = 0,
const Vector2f minUV = Vector2f::Zero(),
const Vector2f maxUV = Vector2f::Ones() 
)
void omega::DrawInterface::drawText ( const String text,
Font font,
const Vector2f position,
unsigned int  align,
Color  color 
)
void omega::DrawInterface::drawWireSphere ( const Color color,
int  segments,
int  slices 
)
void omega::DrawInterface::drawWText ( const std::wstring &  text,
Font font,
const Vector2f position,
unsigned int  align,
Color  color 
)
void omega::DrawInterface::endDraw ( )
void omega::DrawInterface::fillTexture ( TextureSource texture)
GLuint omega::DrawInterface::findUniform ( GLuint  program,
const String name 
)

Uniforms.

Font * omega::DrawInterface::getDefaultFont ( )
inline
Font* omega::DrawInterface::getFont ( omega::String  fontName,
FTGLFontType  type = FTGLTexture 
)
GLuint omega::DrawInterface::getOrCreateProgram ( const String name,
const String vertexShaderFile,
const String fragmentShaderFile 
)

Returns a gpu program by name.

If the program does not exists, it attempts to create it using the passed vertex and fragment shader file names as sources.

GLuint omega::DrawInterface::getOrCreateProgramFromSource ( const String name,
const String vertexShaderSource,
const String fragmentShaderSource 
)

Returns a gpu program by name.

If the program does not exists, it attempts to create it using the passed vertex and fragment shader as sources.

Rect omega::DrawInterface::getScissor ( )
bool omega::DrawInterface::isDrawing ( )
inline
GLuint omega::DrawInterface::makeShaderFromSource ( const char *  source,
ShaderType  Type 
)

Shaders.

void omega::DrawInterface::popTransform ( )
void omega::DrawInterface::program ( GLuint  id)

Loads shader program with the specified id.

void omega::DrawInterface::pushTransform ( const AffineTransform3 transform)
void omega::DrawInterface::rect ( float  x,
float  y,
float  width,
float  height 
)
void omega::DrawInterface::setColor ( const Color col)
inline

New drawing API.

void omega::DrawInterface::setDefaultFont ( Font value)
inline
void omega::DrawInterface::setScissor ( const Rect rect)
void omega::DrawInterface::textureFlip ( uint  flipflags)
void omega::DrawInterface::textureRegion ( float  su,
float  sv,
float  eu,
float  ev 
)
void omega::DrawInterface::uniformFloat ( GLuint  uniform,
float  value 
)

The documentation for this class was generated from the following file: