Loading...
Searching...
No Matches
Gfx Namespace Reference

Namespace for (new) graphics code. More...

## Namespaces

namespace | ModelInput
| Functions related to model loading.
namespace | ModelOutput
| Functions related to model saving.

## Classes

struct | Color
| RGBA color. More...
struct | IntColor
| Color with integer values. More...
struct | ColorHSV
| HSV color. More...
struct | DeviceConfig
| General config for graphics device. More...
struct | DeviceCapabilities
| This structs contains various capabilities of graphics device. More...
class | CFrameBufferPixels
class | CDevice
| Abstract interface of graphics device. More...
struct | FramebufferParams
| Contains parameters for new framebuffer. More...
class | CFramebuffer
| Abstract interface of default framebuffer and offscreen framebuffers. More...
class | CDefaultFramebuffer
| Concrete implementation of default framebuffer. More...
struct | Light
| Properties of light in 3D scene. More...
struct | Material
| Material of a surface. More...
class | CNullDevice
| Device implementation that doesn't render anything. More...
struct | TextureCreateParams
| Parameters for texture creation. More...
struct | TextureStageParams
| Parameters for a texture unit. More...
struct | Texture
| Info about a texture. More...
struct | Vertex
| Vertex of a primitive. More...
struct | VertexCol
| Colored vertex. More...
struct | VertexTex2
| Vertex with secondary texture coordinates. More...
class | CCamera
| Camera moving in 3D scene. More...
class | CCloud
| Cloud layer renderer. More...
struct | EngineMouse
| Information about mouse cursor. More...
struct | EngineTriangle
| A triangle drawn by the graphics engine. More...
struct | EngineBaseObjDataTier
| Tier 3 of object tree (data). More...
struct | EngineBaseObjTexTier
| Tier 2 of base object tree (textures). More...
struct | EngineBaseObject
struct | EngineObject
| Object drawn by the graphics engine. More...
struct | EngineShadow
| Shadow drawn by the graphics engine. More...
struct | EngineGroundSpot
| A spot (large shadow) drawn on the ground by the graphics engine. More...
struct | EngineGroundMark
| A mark on ground drawn by the graphics engine. More...
class | CEngine
| The graphics engine. More...
struct | LightProgression
| Describes the progression of light parameters change. More...
struct | DynamicLight
| Dynamic light in 3D scene. More...
class | CLightManager
| Manager for dynamic lights in 3D scene. More...
class | CLightning
| Lightning effect renderer. More...
class | COldModelManager
| Manager for static models. More...
struct | Particle
struct | Track
struct | WheelTrace
class | CParticle
| Particle engine. More...
class | CPlanet
| Planet manager. More...
class | CPyro
| Fire effect renderer. More...
class | CPyroManager
class | CTerrain
| Terrain loader/generator and manager. More...
struct | MultisizeFont
| Font with multiple possible sizes. More...
struct | FontTexture
| Single texture filled with character textures. More...
struct | CachedFont
| Base TTF font with UTF-8 char cache. More...
class | FontsCache
struct | UTF8Char
| UTF-8 character in font cache. More...
struct | CharTexture
| Texture of font character. More...
class | CText
| Text rendering engine. More...
class | CWater
| Water manager/renderer. More...
class | CModel
| 3D model saved in model file More...
struct | ModelCrashSphere
| Crash sphere data as saved in model file. More...
class | CModelIOException
struct | ModelHeaderV1AndV2
| Header for new model file version 1 and 2. More...
struct | ModelTriangleV1AndV2
| Triangle of new model file version 1 and 2. More...
struct | ModelHeaderV3
| Header for new model file version 3. More...
struct | ModelMeshHeaderV3
| Header for mesh saved in new model file version 3. More...
struct | ModelTriangleV3
| Mesh triangle saved in new model file version 3. More...
struct | OldModelHeader
| Old Colobot binary model header info. More...
struct | OldModelTriangleV1
| Old Colobot binary model file version 1. More...
struct | OldModelTriangleV2
| Old Colobot binary model file version 2. More...
struct | OldModelTriangleV3
| Old Colobot binary model file version 3. More...
class | CModelManager
| Manager for models read from model files. More...
class | CModelMesh
| Mesh data saved in model file. More...
struct | ModelShadowSpot
| Shadow spot data as saved in model file. More...
struct | ModelTriangle
| A single triangle in mesh as saved in model file. More...
class | CGL14Device
| Implementation of CDevice interface in OpenGL. More...
class | CGL21Device
| Implementation of CDevice interface in OpenGL. More...
struct | DynamicBuffer
| Struct for dynamic buffers. More...
class | CGL33Device
| Implementation of CDevice interface in OpenGL 3.3. More...
class | CGLFramebuffer
| Implementation of CFramebuffer interface in OpenGL 3.0+. More...
class | CGLFramebufferEXT
struct | PreparedTextureData
class | CGLFrameBufferPixels
struct | LightLocations
struct | UniformLocations

## Typedefs

using | CPyroUPtr = std::unique_ptr<CPyro>
typedef short | FontMetaChar
| Type used for font character metainfo.

## Enumerations

enum | TextureUnit { TEXTURE_PRIMARY = 0 , TEXTURE_SECONDARY = 1 , TEXTURE_SHADOW = 2 }
| Texture unit values for binding textures. More...
enum | TransformType { TRANSFORM_WORLD , TRANSFORM_VIEW , TRANSFORM_PROJECTION , TRANSFORM_SHADOW }
| Type of transformation in rendering pipeline. More...
enum | RenderState { RENDER_STATE_LIGHTING , RENDER_STATE_BLENDING , RENDER_STATE_FOG , RENDER_STATE_DEPTH_TEST , RENDER_STATE_DEPTH_WRITE , RENDER_STATE_ALPHA_TEST , RENDER_STATE_CULLING , RENDER_STATE_DEPTH_BIAS , RENDER_STATE_SHADOW_MAPPING }
| Render states that can be enabled/disabled. More...
enum | RenderMode { RENDER_MODE_NORMAL , RENDER_MODE_INTERFACE , RENDER_MODE_SHADOW }
| Render modes the graphics device can be in. More...
enum | CompFunc { COMP_FUNC_NEVER , COMP_FUNC_LESS , COMP_FUNC_EQUAL , COMP_FUNC_NOTEQUAL , COMP_FUNC_LEQUAL , COMP_FUNC_GREATER , COMP_FUNC_GEQUAL , COMP_FUNC_ALWAYS }
| Type of function used to compare values. More...
enum | BlendFunc { BLEND_ZERO , BLEND_ONE , BLEND_SRC_COLOR , BLEND_INV_SRC_COLOR , BLEND_DST_COLOR , BLEND_INV_DST_COLOR , BLEND_SRC_ALPHA , BLEND_INV_SRC_ALPHA , BLEND_DST_ALPHA , BLEND_INV_DST_ALPHA , BLEND_SRC_ALPHA_SATURATE }
| Type of blending function. More...
enum | FogMode { FOG_LINEAR , FOG_EXP , FOG_EXP2 }
| Type of fog calculation function. More...
enum | CullMode { CULL_CW , CULL_CCW }
| Culling mode for polygons. More...
enum | ShadeModel { SHADE_FLAT , SHADE_SMOOTH }
| Shade model used in rendering. More...
enum | FillMode { FILL_POINT , FILL_LINES , FILL_POLY }
| Polygon fill mode. More...
enum | PrimitiveType { PRIMITIVE_POINTS , PRIMITIVE_LINES , PRIMITIVE_LINE_STRIP , PRIMITIVE_LINE_LOOP , PRIMITIVE_TRIANGLES , PRIMITIVE_TRIANGLE_STRIP , PRIMITIVE_TRIANGLE_FAN }
| Type of primitive to render. More...
enum | FrustumPlane { FRUSTUM_PLANE_LEFT = 0x01 , FRUSTUM_PLANE_RIGHT = 0x02 , FRUSTUM_PLANE_TOP = 0x04 , FRUSTUM_PLANE_BOTTOM = 0x08 , FRUSTUM_PLANE_FRONT = 0x10 , FRUSTUM_PLANE_BACK = 0x20 , FRUSTUM_PLANE_ALL }
| Planes of frustum space. More...
enum | RenderTarget { RENDER_TARGET_COLOR , RENDER_TARGET_DEPTH , RENDER_TARGET_STENCIL }
| Render targets for rendering to textures. More...
enum | LightType { LIGHT_POINT , LIGHT_SPOT , LIGHT_DIRECTIONAL }
| Type of light in 3D scene. More...
enum | TexImgFormat { TEX_IMG_AUTO , TEX_IMG_RGB , TEX_IMG_BGR , TEX_IMG_RGBA , TEX_IMG_BGRA }
| Format of image data. More...
enum | TexFilter { TEX_FILTER_NEAREST , TEX_FILTER_BILINEAR , TEX_FILTER_TRILINEAR }
| General texture filtering mode. More...
enum | TexMinFilter { TEX_MIN_FILTER_NEAREST , TEX_MIN_FILTER_LINEAR , TEX_MIN_FILTER_NEAREST_MIPMAP_NEAREST , TEX_MIN_FILTER_LINEAR_MIPMAP_NEAREST , TEX_MIN_FILTER_NEAREST_MIPMAP_LINEAR , TEX_MIN_FILTER_LINEAR_MIPMAP_LINEAR }
| Texture minification filter. More...
enum | TexMagFilter { TEX_MAG_FILTER_NEAREST , TEX_MAG_FILTER_LINEAR }
| Texture magnification filter. More...
enum | TexWrapMode { TEX_WRAP_CLAMP , TEX_WRAP_CLAMP_TO_BORDER , TEX_WRAP_REPEAT }
| Wrapping mode for texture coords. More...
enum | TexMixOperation { TEX_MIX_OPER_DEFAULT , TEX_MIX_OPER_REPLACE , TEX_MIX_OPER_MODULATE , TEX_MIX_OPER_ADD , TEX_MIX_OPER_SUBTRACT }
| Multitexture mixing operation. More...
enum | TexMixArgument { TEX_MIX_ARG_TEXTURE , TEX_MIX_ARG_TEXTURE_0 , TEX_MIX_ARG_TEXTURE_1 , TEX_MIX_ARG_TEXTURE_2 , TEX_MIX_ARG_TEXTURE_3 , TEX_MIX_ARG_COMPUTED_COLOR , TEX_MIX_ARG_SRC_COLOR , TEX_MIX_ARG_FACTOR }
| Multitexture mixing argument. More...
enum class | Type : unsigned char { UBYTE = 0 , BYTE , USHORT , SHORT , UINT , INT , HALF , FLOAT , DOUBLE }
enum | VertexType { VERTEX_TYPE_NORMAL , VERTEX_TYPE_TEX2 , VERTEX_TYPE_COL }
enum | CameraType { CAM_TYPE_NULL = 0 , CAM_TYPE_FREE , CAM_TYPE_EDIT , CAM_TYPE_ONBOARD , CAM_TYPE_BACK , CAM_TYPE_FIX , CAM_TYPE_EXPLO , CAM_TYPE_SCRIPT , CAM_TYPE_VISIT , CAM_TYPE_PLANE }
| Type of camera. More...
enum | CameraSmooth { CAM_SMOOTH_NONE = 0 , CAM_SMOOTH_NORM = 1 , CAM_SMOOTH_HARD = 2 }
enum | CenteringPhase { CAM_PHASE_NULL = 0 , CAM_PHASE_START = 1 , CAM_PHASE_WAIT = 2 , CAM_PHASE_STOP = 3 }
enum | CameraEffect { CAM_EFFECT_NULL = 0 , CAM_EFFECT_TERRAFORM = 1 , CAM_EFFECT_CRASH = 2 , CAM_EFFECT_EXPLO = 3 , CAM_EFFECT_SHOT = 4 , CAM_EFFECT_VIBRATION = 5 , CAM_EFFECT_PET = 6 }
enum | CameraOverEffect { CAM_OVER_EFFECT_NULL = 0 , CAM_OVER_EFFECT_BLOOD = 1 , CAM_OVER_EFFECT_FADEIN_WHITE = 2 , CAM_OVER_EFFECT_FADEOUT_WHITE = 3 , CAM_OVER_EFFECT_FADEOUT_BLACK = 4 , CAM_OVER_EFFECT_LIGHTNING = 5 }

enum

EngineRenderState {
ENG_RSTATE_NORMAL = 0 , ENG_RSTATE_TTEXTURE_BLACK = (1<<0) , ENG_RSTATE_TTEXTURE_WHITE = (1<<1) , ENG_RSTATE_TDIFFUSE = (1<<2) ,
ENG_RSTATE_WRAP = (1<<3) , ENG_RSTATE_CLAMP = (1<<4) , ENG_RSTATE_LIGHT = (1<<5) , ENG_RSTATE_DUAL_BLACK = (1<<6) ,
ENG_RSTATE_DUAL_WHITE = (1<<7) , ENG_RSTATE_PART1 = (1<<8) , ENG_RSTATE_PART2 = (1<<9) , ENG_RSTATE_PART3 = (1<<10) ,
ENG_RSTATE_PART4 = (1<<11) , ENG_RSTATE_2FACE = (1<<12) , ENG_RSTATE_ALPHA = (1<<13) , ENG_RSTATE_SECOND = (1<<14) ,
ENG_RSTATE_FOG = (1<<15) , ENG_RSTATE_TCOLOR_BLACK = (1<<16) , ENG_RSTATE_TCOLOR_WHITE = (1<<17) , ENG_RSTATE_TEXT = (1<<18) ,
ENG_RSTATE_OPAQUE_TEXTURE = (1<<19) , ENG_RSTATE_OPAQUE_COLOR = (1<<20) , ENG_RSTATE_TTEXTURE_ALPHA = (1<<21) , ENG_RSTATE_TCOLOR_ALPHA = (1<<22)
}

| Render state of graphics engine. More...
enum | EngineTriangleType { ENG_TRIANGLE_TYPE_TRIANGLES = 1 , ENG_TRIANGLE_TYPE_SURFACE = 2 }
| Type of triangles drawn for engine objects. More...
enum | EngineObjectType { ENG_OBJTYPE_NULL = 0 , ENG_OBJTYPE_TERRAIN = 1 , ENG_OBJTYPE_FIX = 2 , ENG_OBJTYPE_VEHICLE = 3 , ENG_OBJTYPE_DESCENDANT = 4 , ENG_OBJTYPE_QUARTZ = 5 , ENG_OBJTYPE_METAL = 6 }
| Class of graphics engine object. More...
enum | EngineShadowType { ENG_SHADOW_NORM = 0 , ENG_SHADOW_WORM = 1 }
enum | EngineGroundMarkPhase { ENG_GR_MARK_PHASE_NULL = 0 , ENG_GR_MARK_PHASE_INC = 1 , ENG_GR_MARK_PHASE_FIX = 2 , ENG_GR_MARK_PHASE_DEC = 3 }
| Phase of life of an EngineGroundMark. More...
enum | EngineTextureMapping { ENG_TEX_MAPPING_X = 1 , ENG_TEX_MAPPING_Y = 2 , ENG_TEX_MAPPING_Z = 3 , ENG_TEX_MAPPING_1X = 4 , ENG_TEX_MAPPING_1Y = 5 , ENG_TEX_MAPPING_1Z = 6 }
| Type of texture mapping. More...

enum

EngineMouseType {
ENG_MOUSE_NORM = 0 , ENG_MOUSE_WAIT = 1 , ENG_MOUSE_EDIT = 2 , ENG_MOUSE_HAND = 3 ,
ENG_MOUSE_CROSS = 4 , ENG_MOUSE_SHOW = 5 , ENG_MOUSE_NO = 6 , ENG_MOUSE_MOVE = 7 ,
ENG_MOUSE_MOVEH = 8 , ENG_MOUSE_MOVEV = 9 , ENG_MOUSE_MOVED = 10 , ENG_MOUSE_MOVEI = 11 ,
ENG_MOUSE_SCROLLL = 12 , ENG_MOUSE_SCROLLR = 13 , ENG_MOUSE_SCROLLU = 14 , ENG_MOUSE_SCROLLD = 15 ,
ENG_MOUSE_TARGET = 16 , ENG_MOUSE_COUNT
}

| Type of mouse cursor displayed in-game. More...
enum | LightPriority { LIGHT_PRI_HIGHEST = 0 , LIGHT_PRI_HIGH = 1 , LIGHT_PRI_LOW = 2 }
| Priority in light assignment. More...

enum

ParticleType {
PARTIEXPLOT = 1 , PARTIEXPLOO = 2 , PARTIMOTOR = 3 , PARTIGLINT = 4 ,
PARTIBLITZ = 5 , PARTICRASH = 6 , PARTIGAS = 7 , PARTIFIRE = 9 ,
PARTIFIREZ = 10 , PARTIBLUE = 11 , PARTISELY = 12 , PARTISELR = 13 ,
PARTIGUN1 = 18 , PARTIGUN2 = 19 , PARTIGUN3 = 20 , PARTIGUN4 = 21 ,
PARTIFRAG = 22 , PARTIQUEUE = 23 , PARTIORGANIC1 = 24 , PARTIORGANIC2 = 25 ,
PARTISMOKE1 = 26 , PARTISMOKE2 = 27 , PARTISMOKE3 = 28 , PARTIBLOOD = 30 ,
PARTIBLOODM = 31 , PARTIVAPOR = 32 , PARTIVIRUS = 33 , PARTIRAY1 = 43 ,
PARTIRAY2 = 44 , PARTIRAY3 = 45 , PARTIFLAME = 47 , PARTIBUBBLE = 48 ,
PARTIFLIC = 49 , PARTIEJECT = 50 , PARTISCRAPS = 51 , PARTITOTO = 52 ,
PARTIERROR = 53 , PARTIWARNING = 54 , PARTIINFO = 54 , PARTIQUARTZ = 55 ,
PARTISPHERE0 = 56 , PARTISPHERE1 = 57 , PARTISPHERE2 = 58 , PARTISPHERE3 = 59 ,
PARTISPHERE4 = 60 , PARTISPHERE5 = 61 , PARTISPHERE6 = 62 , PARTIGUNDEL = 66 ,
PARTIPART = 67 , PARTITRACK1 = 68 , PARTITRACK2 = 69 , PARTITRACK3 = 70 ,
PARTITRACK4 = 71 , PARTITRACK5 = 72 , PARTITRACK6 = 73 , PARTITRACK7 = 74 ,
PARTITRACK8 = 75 , PARTITRACK9 = 76 , PARTITRACK10 = 77 , PARTITRACK11 = 78 ,
PARTITRACK12 = 79 , PARTIGLINTb = 88 , PARTIGLINTr = 89 , PARTILENS1 = 90 ,
PARTILENS2 = 91 , PARTILENS3 = 92 , PARTILENS4 = 93 , PARTICONTROL = 94 ,
PARTISHOW = 95 , PARTICHOC = 96 , PARTIGFLAT = 97 , PARTIRECOVER = 98 ,
PARTIROOT = 100 , PARTIPLOUF0 = 101 , PARTIDROP = 106 , PARTIFOG0 = 107 ,
PARTIFOG1 = 108 , PARTIFOG2 = 109 , PARTIFOG3 = 110 , PARTIFOG4 = 111 ,
PARTIFOG5 = 112 , PARTIFOG6 = 113 , PARTIFOG7 = 114 , PARTILIMIT1 = 117 ,
PARTILIMIT2 = 118 , PARTILIMIT3 = 119 , PARTIWATER = 121 , PARTIEXPLOG1 = 122 ,
PARTIEXPLOG2 = 123 , PARTIBASE = 124
}

enum | ParticlePhase { PARPHSTART = 0 , PARPHEND = 1 }
enum | PlanetType { Sky , OuterSpace }
| Type of planet which determines when it is displayed. More...

enum

PyroType {
PT_NULL = 0 , PT_FRAGT = 1 , PT_FRAGO = 2 , PT_FRAGW = 4 ,
PT_EXPLOT = 5 , PT_EXPLOO = 6 , PT_EXPLOW = 8 , PT_SHOTT = 9 ,
PT_SHOTH = 10 , PT_SHOTM = 11 , PT_SHOTW = 12 , PT_EGG = 13 ,
PT_BURNT = 14 , PT_BURNO = 15 , PT_SPIDER = 16 , PT_FALL = 17 ,
PT_WPCHECK = 18 , PT_FLCREATE = 19 , PT_FLDELETE = 20 , PT_RESET = 21 ,
PT_WIN = 22 , PT_LOST = 23 , PT_DEADG = 24 , PT_DEADW = 25 ,
PT_FINDING = 26 , PT_FRAGV = 27 , PT_SQUASH = 28
}

| Type of pyro effect. More...
enum | TerrainRes { TR_NULL = 0 , TR_STONE = 1 , TR_URANIUM = 2 , TR_POWER = 3 , TR_KEY_A = 4 , TR_KEY_B = 5 , TR_KEY_C = 6 , TR_KEY_D = 7 }
| Underground resource type. More...
enum | TextAlign { TEXT_ALIGN_RIGHT , TEXT_ALIGN_LEFT , TEXT_ALIGN_CENTER }
| Type of text alignment. More...

enum

FontType : unsigned char {
FONT_BOLD = 0b0000'01'00 , FONT_ITALIC = 0b0000'10'00 , FONT_COMMON = 0b0000'00'00 , FONT_COMMON_BOLD = FONT_COMMON | FONT_BOLD ,
FONT_COMMON_ITALIC = FONT_COMMON | FONT_ITALIC , FONT_STUDIO = 0b0000'00'01 , FONT_STUDIO_BOLD = FONT_STUDIO | FONT_BOLD , FONT_STUDIO_ITALIC = FONT_STUDIO | FONT_ITALIC ,
FONT_SATCOM = 0b0000'00'10 , FONT_SATCOM_BOLD = FONT_SATCOM | FONT_BOLD , FONT_SATCOM_ITALIC = FONT_SATCOM | FONT_ITALIC , FONT_BUTTON = 0b0000'00'11
}

| Type of font. More...
enum | FontTitle { FONT_TITLE_BIG = 0x01 << 4 , FONT_TITLE_NORM = 0x02 << 4 , FONT_TITLE_LITTLE = 0x03 << 4 }
| Size of font title. More...
enum | FontHighlight { FONT_HIGHLIGHT_NONE = 0x00 << 6 , FONT_HIGHLIGHT_TABLE = 0x02 << 6 , FONT_HIGHLIGHT_KEY = 0x03 << 6 , FONT_HIGHLIGHT_TOKEN = 0x04 << 6 , FONT_HIGHLIGHT_TYPE = 0x05 << 6 , FONT_HIGHLIGHT_CONST = 0x06 << 6 , FONT_HIGHLIGHT_THIS = 0x07 << 6 , FONT_HIGHLIGHT_COMMENT = 0x08 << 6 , FONT_HIGHLIGHT_KEYWORD = 0x09 << 6 , FONT_HIGHLIGHT_STRING = 0x0A << 6 }
| Type of color highlight for text. More...
enum | FontMask { FONT_MASK_FONT = 0x00f , FONT_MASK_TITLE = 0x030 , FONT_MASK_HIGHLIGHT = 0x3c0 , FONT_MASK_LINK = 0x400 , FONT_MASK_IMAGE = 0x800 }
| Masks in FontMetaChar for different attributes. More...
enum | SpecialChar { CHAR_TAB = '\t' , CHAR_NEWLINE = '\n' , CHAR_DOT = 1 , CHAR_SQUARE = 2 , CHAR_SKIP_RIGHT = 5 , CHAR_SKIP_LEFT = 6 }
| Special codes for certain characters. More...
enum | WaterType { WATER_NULL = 0 , WATER_TT = 1 , WATER_TO = 2 , WATER_CT = 3 , WATER_CO = 4 }
| Mode of water display. More...
enum class | ModelFormat { Text , Binary , Old }
| Describes model format to use. More...
enum class | ModelLODLevel { Constant = -1 , Low = 1 , Medium = 2 , High = 4 }
| Old level-of-detail enum. More...
enum class | ModelRenderState { TTextureBlack = 1 , TTextureWhite = 2 , Part1 = 256 , Part2 = 512 , Part3 = 1024 , TwoFace = 4096 , Alpha = 8192 }
| Old render state enum (values copied from EngineRenderState). More...
enum class | ModelSpecialMark { None , Part1 , Part2 , Part3 }
| Special marking for some models. More...
enum class | ModelTransparentMode { None , AlphaChannel , MapBlackToAlpha , MapWhiteToAlpha }
| Describes how to deal with texture transparency. More...
enum | ShadowMappingSupport { SMS_NONE , SMS_ARB , SMS_CORE }
enum | FramebufferSupport { FBS_NONE , FBS_EXT , FBS_ARB }

## Functions

ColorHSV | RGB2HSV (Color color)
| Converts a RGB color to HSV color.
Color | HSV2RGB (ColorHSV color)
| Converts a HSV color to RGB color.
Color | IntColorToColor (IntColor color)
IntColor | ColorToIntColor (Color color)
Color | IntensityToColor (float intensity)
int | GetTypeSize (Type type)
| Returns size in bytes of given type.
Gfx::IntColor | ResourceToColor (TerrainRes res)
| Converts TerrainRes to color.
std::string | ToString (FontType type)
bool | InitializeGLEW ()
FramebufferSupport | DetectFramebufferSupport ()
std::unique_ptr< CDevice > | CreateDevice (const DeviceConfig &config, const std::string &name)
| Creates OpenGL device.
int | GetOpenGLVersion ()
| Returns OpenGL version.
int | GetOpenGLVersion (int &major, int &minor)
| Returns OpenGL version.
bool | AreExtensionsSupported (std::string list)
| Checks if extensions in space-delimited list are supported.
std::string | GetHardwareInfo (bool full=false)
| Returns information about graphics card.
int | ClearGLErrors ()
| Clears OpenGL errors.
bool | CheckGLErrors ()
| Checks for OpenGL errors.
GLenum | TranslateGfxPrimitive (PrimitiveType type)
| Translate Gfx primitive type to OpenGL primitive type.
CompFunc | TranslateGLCompFunc (GLenum flag)
GLenum | TranslateGfxCompFunc (CompFunc func)
BlendFunc | TranslateGLBlendFunc (GLenum flag)
GLenum | TranslateGfxBlendFunc (BlendFunc func)
bool | InPlane (Math::Vector normal, float originPlane, Math::Vector center, float radius)
GLenum | TranslateTextureCoordinate (int index)
GLenum | TranslateTextureCoordinateGen (int index)
GLenum | TranslateType (Type type)
std::string | GetLastShaderError ()
GLint | LoadShader (GLint type, const char *filename)
GLint | LinkProgram (int count, GLint shaders[])
std::unique_ptr< CGLFrameBufferPixels > | GetGLFrameBufferPixels (Math::IntPoint size)
PreparedTextureData | PrepareTextureData (ImageData *imageData, TexImgFormat format)

## Variables

const float | MOUSE_EDGE_MARGIN = 0.01f
const Math::IntPoint | MOUSE_SIZE (32, 32)
const std::map< EngineMouseType, EngineMouse > | MOUSE_TYPES
const float | LTNG_PROTECTION_RADIUS = 200.0f
| Radius of lightning protection.
const float | FOG_HSUP = 10.0f
const float | FOG_HINF = 100.0f
const short | MAXPARTICULE = 500
const short | MAXPARTITYPE = 6
const short | MAXTRACK = 100
const short | MAXTRACKLEN = 10
const short | MAXPARTIFOG = 100
const short | MAXWHEELTRACE = 1000
const short | SH_WORLD = 0
const short | SH_FRONT = 1
const short | SH_INTERFACE = 2
const short | SH_MAX = 3
const std::map< TerrainRes, Gfx::IntColor > | RESOURCE_PALETTE
const float | TERRAIN_FLATLIMIT = (5.0f*Math::PI/180.0f)
| Limit of slope considered a flat piece of land.
const float | FONT_SIZE_SMALL = 12.0f
| Standard small font size.
const float | FONT_SIZE_BIG = 18.0f
| Standard big font size.
GLuint | textureCoordinates [] = { GL_S, GL_T, GL_R, GL_Q }
GLuint | textureCoordGen [] = { GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R, GL_TEXTURE_GEN_Q }
std::string | lastShaderError

## Detailed Description

Namespace for (new) graphics code.

This namespace was created to avoid clashing with old code, but now it still serves, defining a border between pure graphics engine and other parts of application.

## Typedef Documentation

## FontMetaChar

typedef short Gfx::FontMetaChar

Type used for font character metainfo.

## Enumeration Type Documentation

## TextureUnit

enum Gfx::TextureUnit

Texture unit values for binding textures.

These enums should be used for indexing textures instead of raw integers.

## TransformType

enum Gfx::TransformType

Type of transformation in rendering pipeline.

## RenderState

enum Gfx::RenderState

Render states that can be enabled/disabled.

## RenderMode

enum Gfx::RenderMode

Render modes the graphics device can be in.

## CompFunc

enum Gfx::CompFunc

Type of function used to compare values.

## BlendFunc

enum Gfx::BlendFunc

Type of blending function.

## FogMode

enum Gfx::FogMode

Type of fog calculation function.

## CullMode

enum Gfx::CullMode

Culling mode for polygons.

Enumerator
CULL_CW | Cull clockwise faces.
CULL_CCW | Cull counter-clockwise faces.

## ShadeModel

enum Gfx::ShadeModel

Shade model used in rendering.

## FillMode

enum Gfx::FillMode

Polygon fill mode.

Enumerator
FILL_POINT | Draw only points.
FILL_LINES | Draw only lines.
FILL_POLY | Draw full polygons.

## PrimitiveType

enum Gfx::PrimitiveType

Type of primitive to render.

## FrustumPlane

enum Gfx::FrustumPlane

Planes of frustum space.

Bitset of flags - can be OR'd together.

## RenderTarget

enum Gfx::RenderTarget

Render targets for rendering to textures.

## LightType

enum Gfx::LightType

Type of light in 3D scene.

## TexImgFormat

enum Gfx::TexImgFormat

Format of image data.

Enumerator
TEX_IMG_AUTO | Try to determine automatically (may not work).
TEX_IMG_RGB | RGB triplet, 3 bytes.
TEX_IMG_BGR | BGR triplet, 3 bytes.
TEX_IMG_RGBA | RGBA triplet, 4 bytes.
TEX_IMG_BGRA | BGRA triplet, 4 bytes.

## TexFilter

enum Gfx::TexFilter

General texture filtering mode.

Corresponds to typical options in game graphics settings.

## TexMinFilter

enum Gfx::TexMinFilter

Texture minification filter.

Corresponds to OpenGL modes but should translate to DirectX too.

## TexMagFilter

enum Gfx::TexMagFilter

Texture magnification filter.

## TexWrapMode

enum Gfx::TexWrapMode

Wrapping mode for texture coords.

## TexMixOperation

enum Gfx::TexMixOperation

Multitexture mixing operation.

Enumerator
TEX_MIX_OPER_DEFAULT | Default operation on default params (modulate on computed & texture).
TEX_MIX_OPER_REPLACE | = Arg1
TEX_MIX_OPER_MODULATE | = Arg1 * Arg2
TEX_MIX_OPER_ADD | = Arg1 + Arg2
TEX_MIX_OPER_SUBTRACT | = Arg1 - Arg2

## TexMixArgument

enum Gfx::TexMixArgument

Multitexture mixing argument.

Enumerator
TEX_MIX_ARG_TEXTURE | Color from current texture.
TEX_MIX_ARG_TEXTURE_0 | Color from texture unit 0.
TEX_MIX_ARG_TEXTURE_1 | Color from texture unit 1.
TEX_MIX_ARG_TEXTURE_2 | Color from texture unit 2.
TEX_MIX_ARG_TEXTURE_3 | Color from texture unit 3.
TEX_MIX_ARG_COMPUTED_COLOR | Color computed by previous texture unit (current in DirectX; previous in OpenGL).
TEX_MIX_ARG_SRC_COLOR | (Source) color of textured fragment (diffuse in DirectX; primary color in OpenGL)
TEX_MIX_ARG_FACTOR | Constant color (texture factor in DirectX; texture env color in OpenGL).

## Type

enum class Gfx::Type : unsigned char

strong

Enumerator
UBYTE | Unsigned byte (8-bit).
BYTE | Signed byte (8-bit).
USHORT | Unsigned short (16-bit).
SHORT | Signed short (16-bit).
UINT | Unsigned int (32-bit).
INT | Signed int (32-bit).
HALF | Half precision floating-point (16-bit).
FLOAT | Single precision floating-point (32-bit).
DOUBLE | Double precision floating-point (64-bit).

## CameraType

enum Gfx::CameraType

Type of camera.

Enumerator
CAM_TYPE_NULL | Undefined.
CAM_TYPE_FREE | Free camera.
CAM_TYPE_EDIT | Camera while editing a program.
CAM_TYPE_ONBOARD | Camera on board a robot.
CAM_TYPE_BACK | Camera behind a robot.
CAM_TYPE_FIX | Static camera following robot.
CAM_TYPE_EXPLO | Camera steady after explosion.
CAM_TYPE_SCRIPT | Camera during a cutscene.
CAM_TYPE_VISIT | Visit camera, rotates around given position.
CAM_TYPE_PLANE | Static camera height.

## CameraSmooth

enum Gfx::CameraSmooth

Enumerator
CAM_SMOOTH_NONE | Sharp.
CAM_SMOOTH_NORM | Normal.
CAM_SMOOTH_HARD | Hard.

## CameraEffect

enum Gfx::CameraEffect

Enumerator
CAM_EFFECT_NULL | No effect.
CAM_EFFECT_TERRAFORM | Digging in.
CAM_EFFECT_CRASH | Hard landing.
CAM_EFFECT_EXPLO | Explosion.
CAM_EFFECT_SHOT | Shot by an enemy.
CAM_EFFECT_VIBRATION | Vibration during construction.
CAM_EFFECT_PET | Overheated reactor.

## CameraOverEffect

enum Gfx::CameraOverEffect

Enumerator
CAM_OVER_EFFECT_NULL | No effect.
CAM_OVER_EFFECT_BLOOD | Flash red.
CAM_OVER_EFFECT_FADEIN_WHITE | White -> nothing.
CAM_OVER_EFFECT_FADEOUT_WHITE | Nothing -> white.
CAM_OVER_EFFECT_FADEOUT_BLACK | Nothing -> blue.
CAM_OVER_EFFECT_LIGHTNING | Lightning.

## EngineRenderState

enum Gfx::EngineRenderState

Render state of graphics engine.

States are used for settings certain modes, for instance texturing and blending. The enum is a bitmask and some of the states can be OR'd together.

Enumerator
ENG_RSTATE_NORMAL | Normal opaque materials.
ENG_RSTATE_TTEXTURE_BLACK | The transparent texture (black = no).
ENG_RSTATE_TTEXTURE_WHITE | The transparent texture (white = no).
ENG_RSTATE_TDIFFUSE | The transparent diffuse color.
ENG_RSTATE_WRAP | Texture wrap.
ENG_RSTATE_CLAMP | Texture borders with solid color.
ENG_RSTATE_LIGHT | Light texture (ambient max).
ENG_RSTATE_DUAL_BLACK | Double black texturing.
ENG_RSTATE_DUAL_WHITE | Double white texturing.
ENG_RSTATE_PART1 | Part 1 (no change in. MOD!).
ENG_RSTATE_PART2 | Part 2.
ENG_RSTATE_PART3 | Part 3.
ENG_RSTATE_PART4 | Part 4.
ENG_RSTATE_2FACE | Double-sided face.
ENG_RSTATE_ALPHA | Image using alpha channel.
ENG_RSTATE_SECOND | Always use 2nd floor texturing.
ENG_RSTATE_FOG | Causes the fog.
ENG_RSTATE_TCOLOR_BLACK | The transparent color (black = no).
ENG_RSTATE_TCOLOR_WHITE | The transparent color (white = no).
ENG_RSTATE_TEXT | Mode for rendering text.
ENG_RSTATE_OPAQUE_TEXTURE | Only opaque texture, no blending, etc.
ENG_RSTATE_OPAQUE_COLOR | Only opaque color, no texture, blending, etc.
ENG_RSTATE_TTEXTURE_ALPHA | Texture using alpha channel.
ENG_RSTATE_TCOLOR_ALPHA | Color with transparency.

## EngineTriangleType

enum Gfx::EngineTriangleType

Type of triangles drawn for engine objects.

Enumerator
ENG_TRIANGLE_TYPE_TRIANGLES | Triangles.
ENG_TRIANGLE_TYPE_SURFACE | Surfaces.

## EngineObjectType

enum Gfx::EngineObjectType

Class of graphics engine object.

Enumerator
ENG_OBJTYPE_NULL | Object doesn't exist.
ENG_OBJTYPE_TERRAIN | Terrain.
ENG_OBJTYPE_FIX | Fixed object.
ENG_OBJTYPE_VEHICLE | Moving object.
ENG_OBJTYPE_DESCENDANT | Part of a moving object.
ENG_OBJTYPE_QUARTZ | Fixed object type quartz.
ENG_OBJTYPE_METAL | Fixed object type metal.

## EngineShadowType

enum Gfx::EngineShadowType

Enumerator
ENG_SHADOW_NORM | Normal shadow.
ENG_SHADOW_WORM | TODO: ?

## EngineGroundMarkPhase

enum Gfx::EngineGroundMarkPhase

Phase of life of an EngineGroundMark.

Enumerator
ENG_GR_MARK_PHASE_NULL | Null phase.
ENG_GR_MARK_PHASE_INC | Increase.
ENG_GR_MARK_PHASE_FIX | Fixed.
ENG_GR_MARK_PHASE_DEC | Decrease.

## EngineTextureMapping

enum Gfx::EngineTextureMapping

Type of texture mapping.

## EngineMouseType

enum Gfx::EngineMouseType

Type of mouse cursor displayed in-game.

Enumerator
ENG_MOUSE_NORM | Normal cursor (arrow).
ENG_MOUSE_WAIT | Busy.
ENG_MOUSE_EDIT | Edit (I-beam).
ENG_MOUSE_HAND | Hand.
ENG_MOUSE_CROSS | Small cross.
ENG_MOUSE_SHOW | TODO: ?
ENG_MOUSE_NO | Crossed out sign.
ENG_MOUSE_MOVE | Resize.
ENG_MOUSE_MOVEH | Resize horizontally.
ENG_MOUSE_MOVEV | Resize vertically.
ENG_MOUSE_MOVED | Resize diagonally bottom-left to top-right.
ENG_MOUSE_MOVEI | Resize diagonally top-left to bottom-right.
ENG_MOUSE_SCROLLL | Scroll to the left.
ENG_MOUSE_SCROLLR | Scroll to the right.
ENG_MOUSE_SCROLLU | Scroll up.
ENG_MOUSE_SCROLLD | Scroll down.
ENG_MOUSE_TARGET | Larger crosshair.
ENG_MOUSE_COUNT | Number of items in enum.

## LightPriority

enum Gfx::LightPriority

Priority in light assignment.

Enumerator
LIGHT_PRI_HIGHEST | always highest weight (always picked)
LIGHT_PRI_HIGH | high weight
LIGHT_PRI_LOW | low weight

## ParticleType

enum Gfx::ParticleType

Enumerator
PARTIEXPLOO | < technology explosion
PARTIMOTOR | < organic explosion
PARTIGLINT | < the engine exhaust gas
PARTIBLITZ | < reflection
PARTICRASH | < lightning recharging battery
PARTIGAS | < dust after fall
PARTIFIRE | < gas from the reactor
PARTIFIREZ | < fireball shrinks
PARTIBLUE | < fireball grows
PARTISELY | < blue ball
PARTISELR | < yellow robot lights
PARTIGUN1 | < red robot lights
PARTIGUN2 | < bullet 1 (fireball)
PARTIGUN3 | < bullet 2 (ant)
PARTIGUN4 | < bullet 3 (spider)
PARTIFRAG | < bullet 4 (orgaball)
PARTIQUEUE | < triangular fragment
PARTIORGANIC1 | < inflamed tail (TODO: unused?)
PARTIORGANIC2 | < organic ball mother
PARTISMOKE1 | < organic ball daughter
PARTISMOKE2 | < black smoke
PARTISMOKE3 | < black smoke
PARTIBLOOD | < black smoke
PARTIBLOODM | < human blood
PARTIVAPOR | < AlienQueen blood
PARTIVIRUS | < steam
PARTIRAY1 | < virus (random letter)
PARTIRAY2 | < ray 1 (turn)
PARTIRAY3 | < ray 2 (electric arc)
PARTIFLAME | < ray 3 (ExchangePost)
PARTIBUBBLE | < flame
PARTIFLIC | < bubble
PARTIEJECT | < circles in the water
PARTISCRAPS | < ejection from the reactor
PARTITOTO | < waste from the reactor
PARTIERROR | < Robby's reactor
PARTIWARNING | < Robby says no
PARTIINFO | < Robby says blah
PARTIQUARTZ | < Robby says yes
PARTISPHERE0 | < reflection crystal
PARTISPHERE1 | < explosion sphere
PARTISPHERE2 | < energy sphere
PARTISPHERE3 | < analysis sphere
PARTISPHERE4 | < shield sphere
PARTISPHERE5 | < information sphere (emit)
PARTISPHERE6 | < botanical sphere (gravity root)
PARTIGUNDEL | < information sphere (receive)
PARTIPART | < bullet destroyed by shield
PARTITRACK1 | < object part
PARTITRACK2 | < drag 1
PARTITRACK3 | < drag 2
PARTITRACK4 | < drag 3
PARTITRACK5 | < drag 4
PARTITRACK6 | < drag 5
PARTITRACK7 | < drag 6
PARTITRACK8 | < drag 7
PARTITRACK9 | < drag 8
PARTITRACK10 | < drag 9
PARTITRACK11 | < drag 10
PARTITRACK12 | < drag 11
PARTIGLINTb | < drag 12 (TODO: unused?)
PARTIGLINTr | < blue reflection
PARTILENS1 | < red reflection
PARTILENS2 | < brilliance 1 (orange)
PARTILENS3 | < brilliance 2 (yellow)
PARTILENS4 | < brilliance 3 (red)
PARTICONTROL | < brilliance 4 (violet)
PARTISHOW | < reflection on button
PARTICHOC | < shows a place
PARTIGFLAT | < shock wave
PARTIRECOVER | < shows if the ground is flat
PARTIROOT | < blue ball recycler
PARTIPLOUF0 | < gravity root smoke
PARTIDROP | < splash
PARTIFOG0 | < drop
PARTIFOG1 | < fog 0
PARTIFOG2 | < fog 1
PARTIFOG3 | < fog 2
PARTIFOG4 | < fog 3
PARTIFOG5 | < fog 4
PARTIFOG6 | < fog 5
PARTIFOG7 | < fog 6
PARTILIMIT1 | < fog 7
PARTILIMIT2 | < shows the limits 1
PARTILIMIT3 | < shows the limits 2
PARTIWATER | < shows the limits 3
PARTIEXPLOG1 | < drop of water
PARTIEXPLOG2 | < ball explosion 1
PARTIBASE | < ball explosion 2

## PlanetType

enum Gfx::PlanetType

Type of planet which determines when it is displayed.

Enumerator
Sky | normal planets, orbiting in the sky
OuterSpace | only visible during spaceship flight

## PyroType

enum Gfx::PyroType

Type of pyro effect.

Enumerator
PT_FRAGO | < fragmentation of technical object
PT_FRAGW | < fragmentation of organic object
PT_EXPLOT | < fragmentation of object under water
PT_EXPLOO | < explosion of technical object
PT_EXPLOW | < explosion of organic object
PT_SHOTT | < explosion of object under water
PT_SHOTH | < hit technical object
PT_SHOTM | < hit human
PT_SHOTW | < hit queen
PT_EGG | < hit under water (TODO: check if unused)
PT_BURNT | < break the egg
PT_BURNO | < burning of technical object
PT_SPIDER | < burning of organic object
PT_FALL | < spider explosion
PT_WPCHECK | < cargo falling
PT_FLCREATE | < indicator reaches
PT_FLDELETE | < flag create
PT_RESET | < flag destroy
PT_WIN | < reset position of the object
PT_LOST | < fireworks
PT_DEADG | < black smoke
PT_DEADW | < shooting death
PT_FINDING | < drowning death
PT_FRAGV | < object discovered
PT_SQUASH | < fragmentation of plant object

## TerrainRes

enum Gfx::TerrainRes

Underground resource type.

Enumerator
TR_NULL | No resource.
TR_STONE | Titanium.
TR_URANIUM | Uranium.
TR_POWER | Energy.
TR_KEY_A | Vault keys.

## TextAlign

enum Gfx::TextAlign

Type of text alignment.

## FontType

enum Gfx::FontType : unsigned char

Type of font.

Bitmask in lower 4 bits (mask 0x00f)

Enumerator
FONT_BOLD | Flag for bold font subtype.
FONT_ITALIC | Flag for italic font subtype.
FONT_COMMON | Default colobot font used for interface.
FONT_COMMON_BOLD | Alias for bold colobot font.
FONT_COMMON_ITALIC | Alias for italic colobot font.
FONT_STUDIO | Studio font used mainly in code editor.
FONT_STUDIO_BOLD | Alias for bold studio font.
FONT_STUDIO_ITALIC | Alias for italic studio font (at this point not used anywhere).
FONT_SATCOM | SatCom font used for interface (currently bold and italic wariants aren't used anywhere).
FONT_SATCOM_BOLD | Alias for bold satcom font.
FONT_SATCOM_ITALIC | Alias for italic satcom font.
FONT_BUTTON | Pseudo-font loaded from textures for buttons, icons, etc.

## FontTitle

enum Gfx::FontTitle

Size of font title.

Used internally by CEdit

Bitmask in 2 bits left shifted 4 (mask 0x030)

## FontHighlight

enum Gfx::FontHighlight

Type of color highlight for text.

Bitmask in 4 bits left shifted 6 (mask 0x3c0)

Enumerator
FONT_HIGHLIGHT_TABLE | code background in SatCom
FONT_HIGHLIGHT_KEY | background for keys in documentation in SatCom
FONT_HIGHLIGHT_TOKEN | keywords in CBot scripts
FONT_HIGHLIGHT_TYPE | types in CBot scripts
FONT_HIGHLIGHT_CONST | constants in CBot scripts
FONT_HIGHLIGHT_THIS | "this" keyword in CBot scripts
FONT_HIGHLIGHT_COMMENT | comments in CBot scripts
FONT_HIGHLIGHT_KEYWORD | builtin keywords in CBot scripts
FONT_HIGHLIGHT_STRING | string literals in CBot scripts

## FontMask

enum Gfx::FontMask

Masks in FontMetaChar for different attributes.

Enumerator
FONT_MASK_FONT | Mask for FontType.
FONT_MASK_TITLE | Mask for FontTitle.
FONT_MASK_HIGHLIGHT | Mask for FontHighlight.
FONT_MASK_LINK | Mask for links.
FONT_MASK_IMAGE | Mask for image bit (TODO: not used?).

## SpecialChar

enum Gfx::SpecialChar

Special codes for certain characters.

Enumerator
CHAR_NEWLINE | Tab character - :
CHAR_DOT | Newline character - arrow pointing down and left.
CHAR_SQUARE | Single dot in the middle.
CHAR_SKIP_RIGHT | Square.
CHAR_SKIP_LEFT | Filled triangle pointing right.

## WaterType

enum Gfx::WaterType

Mode of water display.

Enumerator
WATER_NULL | No water.
WATER_TT | Transparent texture.
WATER_TO | Opaque texture.
WATER_CT | Transparent color.
WATER_CO | Opaque color.

## ModelFormat

enum class Gfx::ModelFormat

strong

Describes model format to use.

Enumerator
Text | new text format
Binary | new binary format
Old | old binary format, deprecated

## ModelLODLevel

enum class Gfx::ModelLODLevel

strong

Old level-of-detail enum.

Deprecated

Enumerator
Constant | triangle is always visible, no matter at what distance
Low | triangle is visible at farthest distance (lowest quality)
Medium | triangle is visible at medium distance (medium quality)
High | triangle is visible at closest distance (highest quality)

## ModelRenderState

enum class Gfx::ModelRenderState

strong

Old render state enum (values copied from EngineRenderState).

Deprecated

Enumerator
TTextureBlack | old ENG_RSTATE_TTEXTURE_BLACK
TTextureWhite | old ENG_RSTATE_TTEXTURE_WHITE
Part1 | old ENG_RSTATE_PART1
Part2 | old ENG_RSTATE_PART2
Part3 | old ENG_RSTATE_PART3
TwoFace | old ENG_RSTATE_2FACE
Alpha | old ENG_RSTATE_ALPHA

## ModelSpecialMark

enum class Gfx::ModelSpecialMark

strong

Special marking for some models.

TODO: refactor/remove in the future

## ModelTransparentMode

enum class Gfx::ModelTransparentMode

strong

Describes how to deal with texture transparency.

TODO: get rid of it in the future (use only alpha channel)

Enumerator
None | no transparency
AlphaChannel | use alpha channel
MapBlackToAlpha | map black color to alpha
MapWhiteToAlpha | map white color to alpha

## ShadowMappingSupport

enum Gfx::ShadowMappingSupport

Enumerator
SMS_ARB | No support for depth textures.
SMS_CORE | ARB extension. Core support

## Function Documentation

## RGB2HSV()

ColorHSV Gfx::RGB2HSV | ( | Color | color | ) |

Converts a RGB color to HSV color.

## HSV2RGB()

Color Gfx::HSV2RGB | ( | ColorHSV | color | ) |

Converts a HSV color to RGB color.

## GetTypeSize()

int Gfx::GetTypeSize | ( | Type | type | ) |

Returns size in bytes of given type.

## ResourceToColor()

Gfx::IntColor Gfx::ResourceToColor | ( | TerrainRes | res | ) |

Converts TerrainRes to color.

## CreateDevice()

std::unique_ptr< CDevice > Gfx::CreateDevice | ( | const DeviceConfig & | config,
|  | const std::string & | name )

Creates OpenGL device.

## GetOpenGLVersion() [1/2]

int Gfx::GetOpenGLVersion | ( |  | ) |

Returns OpenGL version.

## GetOpenGLVersion() [2/2]

int Gfx::GetOpenGLVersion | ( | int & | major,
|  | int & | minor )

Returns OpenGL version.

## AreExtensionsSupported()

bool Gfx::AreExtensionsSupported | ( | std::string | list | ) |

Checks if extensions in space-delimited list are supported.

## GetHardwareInfo()

std::string Gfx::GetHardwareInfo | ( | bool | full | ) |

Returns information about graphics card.

## ClearGLErrors()

int Gfx::ClearGLErrors | ( |  | ) |

Clears OpenGL errors.

## CheckGLErrors()

bool Gfx::CheckGLErrors | ( |  | ) |

Checks for OpenGL errors.

## TranslateGfxPrimitive()

GLenum Gfx::TranslateGfxPrimitive | ( | PrimitiveType | type | ) |

Translate Gfx primitive type to OpenGL primitive type.

## Variable Documentation

## MOUSE_TYPES

const std::map<EngineMouseType, EngineMouse> Gfx::MOUSE_TYPES

Initial value:
= {
{{ENG_MOUSE_NORM}, {EngineMouse( 0, 1, 32, ENG_RSTATE_TTEXTURE_WHITE, ENG_RSTATE_TTEXTURE_BLACK, Math::IntPoint( 1, 1))}},
{{ENG_MOUSE_WAIT}, {EngineMouse( 2, 3, 33, ENG_RSTATE_TTEXTURE_WHITE, ENG_RSTATE_TTEXTURE_BLACK, Math::IntPoint( 8, 12))}},
{{ENG_MOUSE_HAND}, {EngineMouse( 4, 5, 34, ENG_RSTATE_TTEXTURE_WHITE, ENG_RSTATE_TTEXTURE_BLACK, Math::IntPoint( 7, 2))}},
{{ENG_MOUSE_NO}, {EngineMouse( 6, 7, 35, ENG_RSTATE_TTEXTURE_WHITE, ENG_RSTATE_TTEXTURE_BLACK, Math::IntPoint(10, 10))}},
{{ENG_MOUSE_EDIT}, {EngineMouse( 8, 9, -1, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::IntPoint( 6, 10))}},
{{ENG_MOUSE_CROSS}, {EngineMouse(10, 11, -1, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::IntPoint(10, 10))}},
{{ENG_MOUSE_MOVEV}, {EngineMouse(12, 13, -1, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::IntPoint( 5, 11))}},
{{ENG_MOUSE_MOVEH}, {EngineMouse(14, 15, -1, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::IntPoint(11, 5))}},
{{ENG_MOUSE_MOVED}, {EngineMouse(16, 17, -1, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::IntPoint( 9, 9))}},
{{ENG_MOUSE_MOVEI}, {EngineMouse(18, 19, -1, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::IntPoint( 9, 9))}},
{{ENG_MOUSE_MOVE}, {EngineMouse(20, 21, -1, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::IntPoint(11, 11))}},
{{ENG_MOUSE_TARGET}, {EngineMouse(22, 23, -1, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::IntPoint(15, 15))}},
{{ENG_MOUSE_SCROLLL}, {EngineMouse(24, 25, 43, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::IntPoint( 2, 9))}},
{{ENG_MOUSE_SCROLLR}, {EngineMouse(26, 27, 44, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::IntPoint(17, 9))}},
{{ENG_MOUSE_SCROLLU}, {EngineMouse(28, 29, 45, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::IntPoint( 9, 2))}},
{{ENG_MOUSE_SCROLLD}, {EngineMouse(30, 31, 46, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::IntPoint( 9, 17))}},
}
Gfx::ENG_RSTATE_TTEXTURE_WHITE
@ ENG_RSTATE_TTEXTURE_WHITE
The transparent texture (white = no).
Definition engine.h:92
Gfx::ENG_RSTATE_TTEXTURE_BLACK
@ ENG_RSTATE_TTEXTURE_BLACK
The transparent texture (black = no).
Definition engine.h:90
Gfx::ENG_MOUSE_TARGET
@ ENG_MOUSE_TARGET
Larger crosshair.
Definition engine.h:479
Gfx::ENG_MOUSE_WAIT
@ ENG_MOUSE_WAIT
Busy.
Definition engine.h:449
Gfx::ENG_MOUSE_CROSS
@ ENG_MOUSE_CROSS
Small cross.
Definition engine.h:455
Gfx::ENG_MOUSE_SCROLLD
@ ENG_MOUSE_SCROLLD
Scroll down.
Definition engine.h:477
Gfx::ENG_MOUSE_SCROLLR
@ ENG_MOUSE_SCROLLR
Scroll to the right.
Definition engine.h:473
Gfx::ENG_MOUSE_MOVEV
@ ENG_MOUSE_MOVEV
Resize vertically.
Definition engine.h:465
Gfx::ENG_MOUSE_MOVE
@ ENG_MOUSE_MOVE
Resize.
Definition engine.h:461
Gfx::ENG_MOUSE_NO
@ ENG_MOUSE_NO
Crossed out sign.
Definition engine.h:459
Gfx::ENG_MOUSE_MOVEH
@ ENG_MOUSE_MOVEH
Resize horizontally.
Definition engine.h:463
Gfx::ENG_MOUSE_EDIT
@ ENG_MOUSE_EDIT
Edit (I-beam).
Definition engine.h:451
Gfx::ENG_MOUSE_HAND
@ ENG_MOUSE_HAND
Hand.
Definition engine.h:453
Gfx::ENG_MOUSE_SCROLLU
@ ENG_MOUSE_SCROLLU
Scroll up.
Definition engine.h:475
Gfx::ENG_MOUSE_MOVEI
@ ENG_MOUSE_MOVEI
Resize diagonally top-left to bottom-right.
Definition engine.h:469
Gfx::ENG_MOUSE_MOVED
@ ENG_MOUSE_MOVED
Resize diagonally bottom-left to top-right.
Definition engine.h:467
Gfx::ENG_MOUSE_SCROLLL
@ ENG_MOUSE_SCROLLL
Scroll to the left.
Definition engine.h:471
Gfx::ENG_MOUSE_NORM
@ ENG_MOUSE_NORM
Normal cursor (arrow).
Definition engine.h:447
Gfx::EngineMouse
Information about mouse cursor.
Definition engine.cpp:77
Math::IntPoint
2D Point with integer coords
Definition intpoint.h:42

## LTNG_PROTECTION_RADIUS

const float Gfx::LTNG_PROTECTION_RADIUS = 200.0f

Radius of lightning protection.

## RESOURCE_PALETTE

const std::map<TerrainRes, Gfx::IntColor> Gfx::RESOURCE_PALETTE

Initial value:
= {
{TR_STONE, Gfx::IntColor(255, 0, 0)},
{TR_URANIUM, Gfx::IntColor(255, 255, 0)},
{TR_POWER, Gfx::IntColor( 0, 255, 0)},
{TR_KEY_A, Gfx::IntColor( 0, 204, 0)},
{TR_KEY_B, Gfx::IntColor( 51, 204, 0)},
{TR_KEY_C, Gfx::IntColor(102, 204, 0)},
{TR_KEY_D, Gfx::IntColor(153, 204, 0)}
}
Gfx::TR_KEY_A
@ TR_KEY_A
Vault keys.
Definition terrain.h:66
Gfx::TR_STONE
@ TR_STONE
Titanium.
Definition terrain.h:59
Gfx::TR_POWER
@ TR_POWER
Energy.
Definition terrain.h:63
Gfx::TR_URANIUM
@ TR_URANIUM
Uranium.
Definition terrain.h:61
Gfx::IntColor
Color with integer values.
Definition color.h:102

## TERRAIN_FLATLIMIT

const float Gfx::TERRAIN_FLATLIMIT = (5.0f*Math::PI/180.0f)

Limit of slope considered a flat piece of land.

## FONT_SIZE_SMALL

const float Gfx::FONT_SIZE_SMALL = 12.0f

Standard small font size.

## FONT_SIZE_BIG

const float Gfx::FONT_SIZE_BIG = 18.0f

Standard big font size.