gfxAPI.cpp

Engine/source/gfx/gfxAPI.cpp

More...

Public Variables

Public Functions

IMPLEMENT_SCOPE(GFXAPI , GFX , "Graphics subystem." )
IMPLEMENT_STRUCT(GFXVideoMode , GFXVideoMode , GFXAPI , "Descriptor <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> specific video mode." )
ImplementEnumType(GFXAdapterType , "Back-end graphics API used by the <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">subsystem.\n\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )
ImplementEnumType(GFXBlend , "The supported blend <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modes.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )
ImplementEnumType(GFXBlendOp , "The blend <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">operators.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )
ImplementEnumType(GFXCmpFunc , "The supported comparison <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">functions.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )
ImplementEnumType(GFXCullMode , "The <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> cull <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modes.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )
ImplementEnumType(GFXFormat , "The texture <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">formats.\n</a>" "@note Not all formats are supported on all <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">platforms.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )
ImplementEnumType(GFXStencilOp , "The stencil <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">operators.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )
ImplementEnumType(GFXTextureAddressMode , "The texture address <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modes.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )
ImplementEnumType(GFXTextureFilterType , "The texture filter <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">types.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )

Detailed Description

Public Variables

 EndImplementEnumType 

Public Functions

IMPLEMENT_SCOPE(GFXAPI , GFX , "Graphics subystem." )

IMPLEMENT_STRUCT(GFXVideoMode , GFXVideoMode , GFXAPI , "Descriptor <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> specific video mode." )

ImplementEnumType(GFXAdapterType , "Back-end graphics API used by the <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">subsystem.\n\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )

ImplementEnumType(GFXBlend , "The supported blend <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modes.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )

ImplementEnumType(GFXBlendOp , "The blend <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">operators.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )

ImplementEnumType(GFXCmpFunc , "The supported comparison <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">functions.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )

ImplementEnumType(GFXCullMode , "The <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> cull <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modes.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )

ImplementEnumType(GFXFormat , "The texture <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">formats.\n</a>" "@note Not all formats are supported on all <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">platforms.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )

ImplementEnumType(GFXStencilOp , "The stencil <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">operators.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )

ImplementEnumType(GFXTextureAddressMode , "The texture address <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modes.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )

ImplementEnumType(GFXTextureFilterType , "The texture filter <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">types.\n</a>" "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )

  1
  2//-----------------------------------------------------------------------------
  3// Copyright (c) 2012 GarageGames, LLC
  4//
  5// Permission is hereby granted, free of charge, to any person obtaining a copy
  6// of this software and associated documentation files (the "Software"), to
  7// deal in the Software without restriction, including without limitation the
  8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9// sell copies of the Software, and to permit persons to whom the Software is
 10// furnished to do so, subject to the following conditions:
 11//
 12// The above copyright notice and this permission notice shall be included in
 13// all copies or substantial portions of the Software.
 14//
 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 21// IN THE SOFTWARE.
 22//-----------------------------------------------------------------------------
 23
 24#include "gfx/gfxAPI.h"
 25
 26
 27IMPLEMENT_SCOPE( GFXAPI, GFX,,
 28   "Graphics subystem." );
 29
 30IMPLEMENT_STRUCT( GFXVideoMode,
 31   GFXVideoMode, GFXAPI,
 32   "Descriptor for a specific video mode." )
 33   FIELD( resolution, resolution, 1, "Width and height of the <a href="/coding/file/filestreamobject_8cpp/#filestreamobject_8cpp_1a4c6c33dce1b9fd5d7fd0a880e79d5c66">mode</a>'s resolution in pixels." )
 34   FIELD( bitDepth, bitDepth, 1, "Bits per pixel." )
 35   FIELD( refreshRate, refreshRate, 1, "Frequency at which the screen is refreshed (in Hertz)." )
 36   FIELD( fullScreen, fullScreen, 1, "Whether this is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> fullscreen or windowed <a href="/coding/file/filestreamobject_8cpp/#filestreamobject_8cpp_1a4c6c33dce1b9fd5d7fd0a880e79d5c66">mode</a>." )
 37   FIELD( wideScreen, wideScreen, 1, "Whether this is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> widescreen display <a href="/coding/file/filestreamobject_8cpp/#filestreamobject_8cpp_1a4c6c33dce1b9fd5d7fd0a880e79d5c66">mode</a>." )
 38   FIELD( antialiasLevel, antialiasLevel, 1, "Maximum or desired antialiasing level." )
 39END_IMPLEMENT_STRUCT;
 40
 41ImplementEnumType( GFXAdapterType,
 42   "Back-<a href="/coding/namespace/namespaceprimbuild/#namespaceprimbuild_1acf3edd784de91bee46e8a68ea08c9532">end</a> graphics API used by the <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a> subsystem.\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>"
 43   "@ingroup <a href="/coding/file/gfxdevice_8h/#gfxdevice_8h_1afd23debb5edac4f53e564f02e6964c62">GFX</a>" )
 44   { OpenGL, "OpenGL", "OpenGL." },
 45   { Direct3D11, "D3D11", "Direct3D 11." },
 46   { NullDevice, "NullDevice", "Null device for dedicated servers." }
 47EndImplementEnumType;
 48
 49ImplementEnumType( GFXBlend,
 50   "The supported blend modes.\n"
 51   "@ingroup GFX" )
 52
 53   { GFXBlendZero, "GFXBlendZero", "(0, 0, 0, 0)" },
 54   { GFXBlendOne, "GFXBlendOne", "(1, 1, 1, 1)" },
 55   { GFXBlendSrcColor, "GFXBlendSrcColor", "(Rs, Gs, Bs, As)" },
 56   { GFXBlendInvSrcColor, "GFXBlendInvSrcColor", "(1 - Rs, 1 - Gs, 1 - Bs, 1 - As)" },
 57   { GFXBlendSrcAlpha, "GFXBlendSrcAlpha", "(As, As, As, As)" },
 58   { GFXBlendInvSrcAlpha, "GFXBlendInvSrcAlpha", "( 1 - As, 1 - As, 1 - As, 1 - As)" },
 59   { GFXBlendDestAlpha, "GFXBlendDestAlpha", "(Ad Ad Ad Ad)" },
 60   { GFXBlendInvDestAlpha, "GFXBlendInvDestAlpha", "(1 - Ad 1 - Ad 1 - Ad 1 - Ad)" },
 61   { GFXBlendDestColor, "GFXBlendDestColor", "(Rd, Gd, Bd, Ad)" },
 62   { GFXBlendInvDestColor, "GFXBlendInvDestColor", "(1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad)" },
 63   { GFXBlendSrcAlphaSat, "GFXBlendSrcAlphaSat", "(f, f, f, 1) where f = min(As, 1 - Ad)" }
 64
 65EndImplementEnumType;
 66
 67ImplementEnumType( GFXCmpFunc,
 68   "The supported comparison functions.\n"
 69   "@ingroup GFX" )
 70
 71   { GFXCmpNever, "GFXCmpNever" },
 72   { GFXCmpLess, "GFXCmpLess" },
 73   { GFXCmpEqual, "GFXCmpEqual" },
 74   { GFXCmpLessEqual, "GFXCmpLessEqual" },
 75   { GFXCmpGreater, "GFXCmpGreater" },
 76   { GFXCmpNotEqual, "GFXCmpNotEqual" },
 77   { GFXCmpGreaterEqual, "GFXCmpGreaterEqual" },
 78   { GFXCmpAlways, "GFXCmpAlways" },
 79
 80EndImplementEnumType;
 81
 82ImplementEnumType( GFXTextureAddressMode,
 83   "The texture address modes.\n"
 84   "@ingroup GFX" )
 85
 86   { GFXAddressWrap,          "GFXAddressWrap" },
 87   { GFXAddressMirror,        "GFXAddressMirror" },
 88   { GFXAddressClamp,         "GFXAddressClamp" },
 89   { GFXAddressBorder,        "GFXAddressBorder" },
 90   { GFXAddressMirrorOnce,    "GFXAddressMirrorOnce" }
 91
 92EndImplementEnumType;
 93
 94ImplementEnumType( GFXTextureFilterType,
 95   "The texture filter types.\n"
 96   "@ingroup GFX" )
 97
 98   { GFXTextureFilterNone,    "GFXTextureFilterNone" },
 99   { GFXTextureFilterPoint,   "GFXTextureFilterPoint" },
100   { GFXTextureFilterLinear,  "GFXTextureFilterLinear" },
101   { GFXTextureFilterAnisotropic, "GFXTextureFilterAnisotropic" },
102
103EndImplementEnumType;
104
105ImplementEnumType( GFXFormat,
106   "The texture formats.\n"
107   "@note Not all formats are supported on all platforms.\n"
108   "@ingroup GFX" )
109
110   { GFXFormatR8G8B8, "GFXFormatR8G8B8" },
111   { GFXFormatR8G8B8A8, "GFXFormatR8G8B8A8" },
112   { GFXFormatR8G8B8A8_SRGB, "GFXFormatR8G8B8A8_SRGB" },
113   { GFXFormatR8G8B8X8, "GFXFormatR8G8B8X8" },
114   { GFXFormatR32F, "GFXFormatR32F" },
115   { GFXFormatR5G6B5, "GFXFormatR5G6B5" },
116   { GFXFormatR5G5B5A1, "GFXFormatR5G5B5A1" },
117   { GFXFormatR5G5B5X1, "GFXFormatR5G5B5X1" },
118   { GFXFormatA4L4, "GFXFormatA4L4" },
119   { GFXFormatA8L8, "GFXFormatA8L8" },
120   { GFXFormatA8, "GFXFormatA8" },
121   { GFXFormatL8, "GFXFormatL8" },
122   { GFXFormatBC1, "GFXFormatBC1" },
123   { GFXFormatBC2, "GFXFormatBC2" }, 
124   { GFXFormatBC3, "GFXFormatBC3" }, 
125   { GFXFormatBC4, "GFXFormatBC4" }, 
126   { GFXFormatBC5, "GFXFormatBC5" }, 
127   { GFXFormatD32, "GFXFormatD32" }, 
128   { GFXFormatD24X8, "GFXFormatD24X8" },
129   { GFXFormatD24S8, "GFXFormatD24S8" },
130   { GFXFormatD24FS8, "GFXFormatD24FS8" },
131   { GFXFormatD16, "GFXFormatD16" }, 
132
133   { GFXFormatR32G32B32A32F, "GFXFormatR32G32B32A32F" }, 
134   { GFXFormatR16G16B16A16F, "GFXFormatR16G16B16A16F" }, 
135   { GFXFormatL16, "GFXFormatL16" }, 
136   { GFXFormatR16G16B16A16, "GFXFormatR16G16B16A16" }, 
137   { GFXFormatR16G16, "GFXFormatR16G16" }, 
138   { GFXFormatR16F, "GFXFormatR16F" }, 
139   { GFXFormatR16G16F, "GFXFormatR16G16F" }, 
140   { GFXFormatR10G10B10A2, "GFXFormatR10G10B10A2" },
141
142EndImplementEnumType;
143
144
145ImplementEnumType( GFXCullMode,
146   "The render cull modes.\n"
147   "@ingroup GFX" )
148
149   { GFXCullNone, "GFXCullNone" },
150   { GFXCullCW, "GFXCullCW" },
151   { GFXCullCCW, "GFXCullCCW" }
152
153EndImplementEnumType;
154
155
156ImplementEnumType( GFXStencilOp,
157   "The stencil operators.\n"
158   "@ingroup GFX" )
159
160   { GFXStencilOpKeep, "GFXStencilOpKeep" },
161   { GFXStencilOpZero, "GFXStencilOpZero" },
162   { GFXStencilOpReplace, "GFXStencilOpReplace" },
163   { GFXStencilOpIncrSat, "GFXStencilOpIncrSat" },
164   { GFXStencilOpDecrSat, "GFXStencilOpDecrSat" },
165   { GFXStencilOpInvert, "GFXStencilOpInvert" },
166   { GFXStencilOpIncr, "GFXStencilOpIncr" },
167   { GFXStencilOpDecr, "GFXStencilOpDecr" },
168
169EndImplementEnumType;
170
171
172ImplementEnumType( GFXBlendOp,
173   "The blend operators.\n"
174   "@ingroup GFX" )
175
176   { GFXBlendOpAdd, "GFXBlendOpAdd" },
177   { GFXBlendOpSubtract, "GFXBlendOpSubtract" },
178   { GFXBlendOpRevSubtract, "GFXBlendOpRevSubtract" },
179   { GFXBlendOpMin, "GFXBlendOpMin" },
180   { GFXBlendOpMax, "GFXBlendOpMax" }
181
182EndImplementEnumType;
183