NTrace
GPU ray tracing framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FW::GLContext Class Reference

#include <GLContext.hpp>

Classes

struct  Config
 
class  Program
 

Public Types

enum  FontStyle { FontStyle_Normal = 0, FontStyle_Bold = 1 << 0, FontStyle_Italic = 1 << 1, FontStyle_BoldItalic = FontStyle_Bold | FontStyle_Italic }
 

Public Member Functions

 GLContext (HDC hdc, const Config &config=Config())
 
 GLContext (HDC hdc, HGLRC hglrc)
 
 ~GLContext (void)
 
const ConfiggetConfig (void) const
 
void makeCurrent (void)
 
void swapBuffers (void)
 
void setView (const Vec2i &pos, const Vec2i &size)
 
const Vec2igetViewPos (void) const
 
const Vec2igetViewSize (void) const
 
const Vec2fgetViewScale (void) const
 
Mat4f xformFitToView (const Vec2f &pos, const Vec2f &size) const
 
Mat4f xformMatchPixels (void) const
 
Mat4f xformMouseToUser (const Mat4f &userToClip) const
 
void setAttrib (int loc, int size, GLenum type, int stride, Buffer *buffer, const void *pointer)
 
void setAttrib (int loc, int size, GLenum type, int stride, const void *pointer)
 
void setAttrib (int loc, int size, GLenum type, int stride, Buffer &buffer, int ofs)
 
void resetAttribs (void)
 
void setUniform (int loc, S32 v)
 
void setUniform (int loc, F32 v)
 
void setUniform (int loc, F64 v)
 
void setUniform (int loc, const Vec2f &v)
 
void setUniform (int loc, const Vec3f &v)
 
void setUniform (int loc, const Vec4f &v)
 
void setUniform (int loc, const Mat2f &v)
 
void setUniform (int loc, const Mat3f &v)
 
void setUniform (int loc, const Mat4f &v)
 
const Mat4fgetVGXform (void) const
 
Mat4f setVGXform (const Mat4f &m)
 
void strokeLine (const Vec4f &p0, const Vec4f &p1, U32 abgr)
 
void strokeLine (const Vec2f &p0, const Vec2f &p1, U32 abgr)
 
void fillRect (const Vec4f &pos, const Vec2f &localSize, const Vec2f &screenSize, U32 abgr)
 
void fillRect (const Vec2f &pos, const Vec2f &localSize, U32 abgr)
 
void fillRectNS (const Vec4f &pos, const Vec2f &screenSize, U32 abgr)
 
void fillRectNS (const Vec2f &pos, const Vec2f &screenSize, U32 abgr)
 
void drawBox (const Vec3f &min, const Vec3f &max, U32 abgr)
 
void drawBuffer (Buffer &buffer, GLenum mode, int offset, U32 abgr)
 
void drawColorBuffer (Buffer &buffer, Buffer &color, GLenum mode, int offset)
 
void strokeRect (const Vec4f &pos, const Vec2f &localSize, const Vec2f &screenSize, U32 abgr)
 
void strokeRect (const Vec2f &pos, const Vec2f &localSize, U32 abgr)
 
void strokeRectNS (const Vec4f &pos, const Vec2f &screenSize, U32 abgr)
 
void strokeRectNS (const Vec2f &pos, const Vec2f &screenSize, U32 abgr)
 
void setFont (const String &name, int size, U32 style)
 
void setDefaultFont (void)
 
int getFontHeight (void) const
 
Vec2i getStringSize (const String &str)
 
Vec2i drawString (const String &str, const Vec4f &pos, const Vec2f &align, U32 abgr)
 
Vec2i drawString (const String &str, const Vec2f &pos, const Vec2f &align, U32 abgr)
 
Vec2i drawString (const String &str, const Vec2f &pos, U32 abgr)
 
Vec2i drawLabel (const String &str, const Vec4f &pos, const Vec2f &align, U32 fgABGR, U32 bgABGR)
 
Vec2i drawLabel (const String &str, const Vec4f &pos, const Vec2f &align, U32 abgr)
 
Vec2i drawLabel (const String &str, const Vec2f &pos, const Vec2f &align, U32 abgr)
 
Vec2i drawLabel (const String &str, const Vec2f &pos, U32 abgr)
 
void drawModalMessage (const String &msg)
 
void drawImage (const Image &image, const Vec4f &pos, const Vec2f &align, bool topToBottom=true)
 
void drawImage (const Image &image, const Vec2f &pos, const Vec2f &align=0.5f, bool topToBottom=true)
 
ProgramgetProgram (const String &id) const
 
void setProgram (const String &id, Program *prog)
 

Static Public Member Functions

static void staticInit (void)
 
static void staticDeinit (void)
 
static GLContextgetHeadless (void)
 
static bool isStereoAvailable (void)
 
static void checkErrors (void)
 

Detailed Description

Definition at line 47 of file GLContext.hpp.

Member Enumeration Documentation

Enumerator
FontStyle_Normal 
FontStyle_Bold 
FontStyle_Italic 
FontStyle_BoldItalic 

Definition at line 53 of file GLContext.hpp.

Constructor & Destructor Documentation

GLContext::GLContext ( HDC  hdc,
const Config config = Config() 
)

Definition at line 210 of file GLContext.cpp.

GLContext::GLContext ( HDC  hdc,
HGLRC  hglrc 
)

Definition at line 201 of file GLContext.cpp.

GLContext::~GLContext ( void  )

Definition at line 245 of file GLContext.cpp.

Member Function Documentation

void GLContext::checkErrors ( void  )
static

Definition at line 1003 of file GLContext.cpp.

void GLContext::drawBox ( const Vec3f min,
const Vec3f max,
U32  abgr 
)

Definition at line 383 of file GLContext.cpp.

void GLContext::drawBuffer ( Buffer buffer,
GLenum  mode,
int  offset,
U32  abgr 
)

Definition at line 479 of file GLContext.cpp.

void GLContext::drawColorBuffer ( Buffer buffer,
Buffer color,
GLenum  mode,
int  offset 
)

Definition at line 558 of file GLContext.cpp.

void GLContext::drawImage ( const Image image,
const Vec4f pos,
const Vec2f align,
bool  topToBottom = true 
)

Definition at line 808 of file GLContext.cpp.

void FW::GLContext::drawImage ( const Image image,
const Vec2f pos,
const Vec2f align = 0.5f,
bool  topToBottom = true 
)
inline

Definition at line 202 of file GLContext.hpp.

Vec2i GLContext::drawLabel ( const String str,
const Vec4f pos,
const Vec2f align,
U32  fgABGR,
U32  bgABGR 
)

Definition at line 704 of file GLContext.cpp.

Vec2i GLContext::drawLabel ( const String str,
const Vec4f pos,
const Vec2f align,
U32  abgr 
)

Definition at line 778 of file GLContext.cpp.

Vec2i FW::GLContext::drawLabel ( const String str,
const Vec2f pos,
const Vec2f align,
U32  abgr 
)
inline

Definition at line 197 of file GLContext.hpp.

Vec2i FW::GLContext::drawLabel ( const String str,
const Vec2f pos,
U32  abgr 
)
inline

Definition at line 198 of file GLContext.hpp.

void GLContext::drawModalMessage ( const String msg)

Definition at line 786 of file GLContext.cpp.

Vec2i FW::GLContext::drawString ( const String str,
const Vec4f pos,
const Vec2f align,
U32  abgr 
)
inline

Definition at line 192 of file GLContext.hpp.

Vec2i FW::GLContext::drawString ( const String str,
const Vec2f pos,
const Vec2f align,
U32  abgr 
)
inline

Definition at line 193 of file GLContext.hpp.

Vec2i FW::GLContext::drawString ( const String str,
const Vec2f pos,
U32  abgr 
)
inline

Definition at line 194 of file GLContext.hpp.

void GLContext::fillRect ( const Vec4f pos,
const Vec2f localSize,
const Vec2f screenSize,
U32  abgr 
)

Definition at line 357 of file GLContext.cpp.

void FW::GLContext::fillRect ( const Vec2f pos,
const Vec2f localSize,
U32  abgr 
)
inline

Definition at line 176 of file GLContext.hpp.

void FW::GLContext::fillRectNS ( const Vec4f pos,
const Vec2f screenSize,
U32  abgr 
)
inline

Definition at line 177 of file GLContext.hpp.

void FW::GLContext::fillRectNS ( const Vec2f pos,
const Vec2f screenSize,
U32  abgr 
)
inline

Definition at line 178 of file GLContext.hpp.

const Config& FW::GLContext::getConfig ( void  ) const
inline

Definition at line 141 of file GLContext.hpp.

int FW::GLContext::getFontHeight ( void  ) const
inline

Definition at line 190 of file GLContext.hpp.

static GLContext& FW::GLContext::getHeadless ( void  )
inlinestatic

Definition at line 209 of file GLContext.hpp.

GLContext::Program * GLContext::getProgram ( const String id) const

Definition at line 867 of file GLContext.cpp.

Vec2i GLContext::getStringSize ( const String str)

Definition at line 674 of file GLContext.cpp.

const Mat4f& FW::GLContext::getVGXform ( void  ) const
inline

Definition at line 170 of file GLContext.hpp.

const Vec2i& FW::GLContext::getViewPos ( void  ) const
inline

Definition at line 147 of file GLContext.hpp.

const Vec2f& FW::GLContext::getViewScale ( void  ) const
inline

Definition at line 149 of file GLContext.hpp.

const Vec2i& FW::GLContext::getViewSize ( void  ) const
inline

Definition at line 148 of file GLContext.hpp.

static bool FW::GLContext::isStereoAvailable ( void  )
inlinestatic

Definition at line 210 of file GLContext.hpp.

void GLContext::makeCurrent ( void  )

Definition at line 260 of file GLContext.cpp.

void GLContext::resetAttribs ( void  )

Definition at line 323 of file GLContext.cpp.

void GLContext::setAttrib ( int  loc,
int  size,
GLenum  type,
int  stride,
Buffer buffer,
const void pointer 
)

Definition at line 310 of file GLContext.cpp.

void FW::GLContext::setAttrib ( int  loc,
int  size,
GLenum  type,
int  stride,
const void pointer 
)
inline

Definition at line 156 of file GLContext.hpp.

void FW::GLContext::setAttrib ( int  loc,
int  size,
GLenum  type,
int  stride,
Buffer buffer,
int  ofs 
)
inline

Definition at line 157 of file GLContext.hpp.

void FW::GLContext::setDefaultFont ( void  )
inline

Definition at line 188 of file GLContext.hpp.

void GLContext::setFont ( const String name,
int  size,
U32  style 
)

Definition at line 645 of file GLContext.cpp.

void GLContext::setProgram ( const String id,
Program prog 
)

Definition at line 875 of file GLContext.cpp.

void FW::GLContext::setUniform ( int  loc,
S32  v 
)
inline

Definition at line 160 of file GLContext.hpp.

void FW::GLContext::setUniform ( int  loc,
F32  v 
)
inline

Definition at line 161 of file GLContext.hpp.

void FW::GLContext::setUniform ( int  loc,
F64  v 
)
inline

Definition at line 162 of file GLContext.hpp.

void FW::GLContext::setUniform ( int  loc,
const Vec2f v 
)
inline

Definition at line 163 of file GLContext.hpp.

void FW::GLContext::setUniform ( int  loc,
const Vec3f v 
)
inline

Definition at line 164 of file GLContext.hpp.

void FW::GLContext::setUniform ( int  loc,
const Vec4f v 
)
inline

Definition at line 165 of file GLContext.hpp.

void FW::GLContext::setUniform ( int  loc,
const Mat2f v 
)
inline

Definition at line 166 of file GLContext.hpp.

void FW::GLContext::setUniform ( int  loc,
const Mat3f v 
)
inline

Definition at line 167 of file GLContext.hpp.

void FW::GLContext::setUniform ( int  loc,
const Mat4f v 
)
inline

Definition at line 168 of file GLContext.hpp.

Mat4f FW::GLContext::setVGXform ( const Mat4f m)
inline

Definition at line 171 of file GLContext.hpp.

void GLContext::setView ( const Vec2i pos,
const Vec2i size 
)

Definition at line 287 of file GLContext.cpp.

void GLContext::staticDeinit ( void  )
static

Definition at line 962 of file GLContext.cpp.

void GLContext::staticInit ( void  )
static

Definition at line 894 of file GLContext.cpp.

void GLContext::strokeLine ( const Vec4f p0,
const Vec4f p1,
U32  abgr 
)

Definition at line 333 of file GLContext.cpp.

void FW::GLContext::strokeLine ( const Vec2f p0,
const Vec2f p1,
U32  abgr 
)
inline

Definition at line 174 of file GLContext.hpp.

void GLContext::strokeRect ( const Vec4f pos,
const Vec2f localSize,
const Vec2f screenSize,
U32  abgr 
)

Definition at line 613 of file GLContext.cpp.

void FW::GLContext::strokeRect ( const Vec2f pos,
const Vec2f localSize,
U32  abgr 
)
inline

Definition at line 183 of file GLContext.hpp.

void FW::GLContext::strokeRectNS ( const Vec4f pos,
const Vec2f screenSize,
U32  abgr 
)
inline

Definition at line 184 of file GLContext.hpp.

void FW::GLContext::strokeRectNS ( const Vec2f pos,
const Vec2f screenSize,
U32  abgr 
)
inline

Definition at line 185 of file GLContext.hpp.

void GLContext::swapBuffers ( void  )

Definition at line 276 of file GLContext.cpp.

Mat4f FW::GLContext::xformFitToView ( const Vec2f pos,
const Vec2f size 
) const
inline

Definition at line 151 of file GLContext.hpp.

Mat4f FW::GLContext::xformMatchPixels ( void  ) const
inline

Definition at line 152 of file GLContext.hpp.

Mat4f GLContext::xformMouseToUser ( const Mat4f userToClip) const

Definition at line 298 of file GLContext.cpp.


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