00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __SP_MATERIAL_CONFIG_TYPES_H__
00009 #define __SP_MATERIAL_CONFIG_TYPES_H__
00010
00011
00012 #include "Base/spStandard.hpp"
00013 #include "Base/spDimension.hpp"
00014 #include "RenderSystem/spTextureBase.hpp"
00015
00016 #include <limits.h>
00017 #include <boost/function.hpp>
00018
00019
00020 namespace sp
00021 {
00022
00023 namespace scene { class Mesh; }
00024
00025 namespace video
00026 {
00027
00028
00029 class MeshBuffer;
00030 class TextureLayer;
00031
00032
00033
00034
00035
00037 static const u8 TEXTURE_IGNORE = UCHAR_MAX;
00039 static const u8 TEXLAYER_LAST = UCHAR_MAX;
00041 static const c8* TEXPATH_IGNORE = "?";
00042
00044 static const s32 DEF_TEXTURE_SIZE = 1;
00046 static const s32 DEF_SCREENSHOT_SIZE = 256;
00048 static const s32 DEF_FONT_SIZE = 15;
00049
00050
00059 typedef boost::function<void (scene::Mesh* Obj, bool isBegin)> UserMaterialCallback;
00060
00068 typedef boost::function<void (scene::Mesh* Obj, const std::vector<MeshBuffer*> &LODSurfaceList, u32 LODIndex)> UserRenderCallback;
00069
00071 typedef std::vector<TextureLayer*> TextureLayerListType;
00072
00073
00074
00075
00076
00077
00079 enum EShadeModeTypes
00080 {
00081 SHADEMODE_SMOOTH,
00082 SHADEMODE_FLAT
00083 };
00084
00086 enum EClearBufferTypes
00087 {
00088 BUFFER_COLOR = 0x01,
00089 BUFFER_DEPTH = 0x02,
00090 BUFFER_STENCIL = 0x04,
00091 BUFFER_ALL = ~0,
00092 };
00093
00095 enum EFogTypes
00096 {
00097 FOG_NONE = 0,
00098 FOG_STATIC,
00099 FOG_VOLUMETRIC
00100 };
00101
00103 enum EFogModes
00104 {
00105 FOG_PALE,
00106 FOG_THICK,
00107 };
00108
00110 enum ETextureGenFlags
00111 {
00112 TEXGEN_FILTER,
00113 TEXGEN_MAGFILTER,
00114 TEXGEN_MINFILTER,
00115
00116 TEXGEN_MIPMAPFILTER,
00117 TEXGEN_MIPMAPS,
00118
00119 TEXGEN_WRAP,
00120 TEXGEN_WRAP_U,
00121 TEXGEN_WRAP_V,
00122 TEXGEN_WRAP_W,
00123
00124 TEXGEN_ANISOTROPY,
00125 };
00126
00128 enum EGraphicsVendorIDs
00129 {
00130 VENDOR_UNKNOWN = 0x0000,
00131 VENDOR_ATI = 0x1002,
00132 VENDOR_NVIDIA = 0x10DE,
00133 VENDOR_MATROX = 0x102B,
00134 VENDOR_3DFX = 0x121A,
00135 VENDOR_S3GC = 0x5333,
00136 VENDOR_INTEL = 0x8086,
00137 };
00138
00140 enum ETextDrawingFlags
00141 {
00142 TEXT_CENTER_HORZ = 0x0001,
00143 TEXT_CENTER_VERT = 0x0002,
00144 TEXT_CENTER = TEXT_CENTER_HORZ | TEXT_CENTER_VERT,
00145 TEXT_RIGHT_ALIGN = 0x0004,
00146 };
00147
00149 enum EShaderLoadingFlags
00150 {
00151 SHADERFLAG_ALLOW_INCLUDES = 0x0001,
00152 };
00153
00158 enum EDefaultTextures
00159 {
00168 DEFAULT_TEXTURE_TILES = 0,
00169
00170 DEFAULT_TEXTURE_COUNT,
00171 };
00172
00179 enum ERenderModes
00180 {
00181 RENDERMODE_NONE,
00182 RENDERMODE_DRAWING_2D,
00183 RENDERMODE_DRAWING_3D,
00184 RENDERMODE_SCENE,
00185 };
00186
00188 enum ERenderSystems
00189 {
00190 RENDERER_AUTODETECT,
00191 RENDERER_OPENGL,
00192 RENDERER_OPENGLES1,
00193 RENDERER_OPENGLES2,
00194 RENDERER_DIRECT3D9,
00195 RENDERER_DIRECT3D11,
00196 RENDERER_DUMMY,
00197 };
00198
00200 enum EWireframeTypes
00201 {
00202 WIREFRAME_POINTS = 0,
00203 WIREFRAME_LINES,
00204 WIREFRAME_SOLID,
00205 };
00206
00208 enum EFaceTypes
00209 {
00210 FACE_FRONT,
00211 FACE_BACK,
00212 FACE_BOTH
00213 };
00214
00216 enum EShadingTypes
00217 {
00218 SHADING_FLAT,
00219 SHADING_GOURAUD,
00220 SHADING_PHONG,
00221 SHADING_PERPIXEL,
00222 };
00223
00225 enum ESizeComparisionTypes
00226 {
00227 CMPSIZE_NEVER = 0,
00228 CMPSIZE_EQUAL,
00229 CMPSIZE_NOTEQUAL,
00230 CMPSIZE_LESS,
00231 CMPSIZE_LESSEQUAL,
00232 CMPSIZE_GREATER,
00233 CMPSIZE_GREATEREQUAL,
00234 CMPSIZE_ALWAYS,
00235 };
00236
00237 enum EStencilOperations
00238 {
00239 STENCIL_KEEP,
00240 STENCIL_ZERO,
00241 STENCIL_REPLACE,
00242 STENCIL_INCR_CLAMP,
00243 STENCIL_INCR,
00244 STENCIL_DECR_CLAMP,
00245 STENCIL_DECR,
00246 STENCIL_INVERT,
00247 };
00248
00250 enum EBlendingTypes
00251 {
00252 BLEND_ZERO = 0,
00253 BLEND_ONE,
00254 BLEND_SRCCOLOR,
00255 BLEND_INVSRCCOLOR,
00256 BLEND_SRCALPHA,
00257 BLEND_INVSRCALPHA,
00258 BLEND_DESTCOLOR,
00259 BLEND_INVDESTCOLOR,
00260 BLEND_DESTALPHA,
00261 BLEND_INVDESTALPHA,
00262 };
00263
00265 enum EDefaultBlendingTypes
00266 {
00267 BLEND_NORMAL,
00268 BLEND_BRIGHT,
00269 BLEND_DARK,
00270 };
00271
00273 enum ETextureEnvTypes
00274 {
00275 TEXENV_MODULATE = 0,
00276 TEXENV_REPLACE,
00277 TEXENV_ADD,
00278 TEXENV_ADDSIGNED,
00279 TEXENV_SUBTRACT,
00280 TEXENV_INTERPOLATE,
00281 TEXENV_DOT3,
00282 };
00283
00285 enum EMappingGenTypes
00286 {
00287 MAPGEN_DISABLE = 0,
00288 MAPGEN_OBJECT_LINEAR,
00289 MAPGEN_EYE_LINEAR,
00290 MAPGEN_SPHERE_MAP,
00291 MAPGEN_NORMAL_MAP,
00292 MAPGEN_REFLECTION_MAP,
00293 };
00294
00296 enum EMappingGenCoords
00297 {
00298 MAPGEN_NONE = 0x0000,
00299 MAPGEN_S = 0x0001,
00300 MAPGEN_T = 0x0002,
00301 MAPGEN_R = 0x0004,
00302 MAPGEN_Q = 0x0008,
00303 };
00304
00306 enum ERenderStates
00307 {
00308 RENDER_ALPHATEST,
00309 RENDER_BLEND,
00310 RENDER_COLORMATERIAL,
00311 RENDER_CULLFACE,
00312 RENDER_DEPTH,
00313 RENDER_DITHER,
00314 RENDER_FOG,
00315 RENDER_LIGHTING,
00316 RENDER_LINESMOOTH,
00317 RENDER_MULTISAMPLE,
00318 RENDER_NORMALIZE,
00319 RENDER_POINTSMOOTH,
00320 RENDER_RESCALENORMAL,
00321 RENDER_SCISSOR,
00322 RENDER_STENCIL,
00323 RENDER_TEXTURE,
00324 RENDER_TEXTURECUBEMAP,
00325 RENDER_TEXTURE_LOD_BIAS,
00326 };
00327
00329 enum EVideoFeatureQueries
00330 {
00331
00332 QUERY_ANTIALIASING,
00333 QUERY_STENCIL_BUFFER,
00334 QUERY_VOLUMETRIC_FOG,
00335
00336
00337 QUERY_HARDWARE_MESHBUFFER,
00338 QUERY_HARDWARE_INSTANCING,
00339
00340
00341 QUERY_RENDERTARGET,
00342 QUERY_MULTI_TEXTURE,
00343 QUERY_MULTISAMPLE_TEXTURE,
00344 QUERY_MULTISAMPLE_RENDERTARGET,
00345 QUERY_BILINEAR_FILTER,
00346 QUERY_TRILINEAR_FILTER,
00347 QUERY_ANISOTROPY_FILTER,
00348 QUERY_MIPMAPS,
00349 QUERY_VOLUMETRIC_TEXTURE,
00350 QUERY_CUBEMAP_ARRAY,
00351
00352
00353 QUERY_SHADER,
00354 QUERY_GEOMETRY_SHADER,
00355 QUERY_TESSELLATION_SHADER,
00356 QUERY_VETEX_PROGRAM,
00357 QUERY_FRAGMENT_PROGRAM,
00358 QUERY_CONSTANT_BUFFER,
00359 QUERY_GLSL,
00360 QUERY_HLSL,
00361 QUERY_VERTEX_SHADER_1_1,
00362 QUERY_VERTEX_SHADER_2_0,
00363 QUERY_VERTEX_SHADER_3_0,
00364 QUERY_VERTEX_SHADER_4_0,
00365 QUERY_VERTEX_SHADER_4_1,
00366 QUERY_VERTEX_SHADER_5_0,
00367 QUERY_PIXEL_SHADER_1_1,
00368 QUERY_PIXEL_SHADER_1_2,
00369 QUERY_PIXEL_SHADER_1_3,
00370 QUERY_PIXEL_SHADER_1_4,
00371 QUERY_PIXEL_SHADER_2_0,
00372 QUERY_PIXEL_SHADER_3_0,
00373 QUERY_PIXEL_SHADER_4_0,
00374 QUERY_PIXEL_SHADER_4_1,
00375 QUERY_PIXEL_SHADER_5_0,
00376 };
00377
00379 enum ERenderPrimitives
00380 {
00381 PRIMITIVE_POINTS = 0,
00382 PRIMITIVE_LINES,
00383 PRIMITIVE_LINE_STRIP,
00384 PRIMITIVE_LINE_LOOP,
00385 PRIMITIVE_TRIANGLES,
00386 PRIMITIVE_TRIANGLE_STRIP,
00387 PRIMITIVE_TRIANGLE_FAN,
00388 PRIMITIVE_QUADS,
00389 PRIMITIVE_QUAD_STRIP,
00390 PRIMITIVE_POLYGON,
00391 PRIMITIVE_LINE_STRIP_ADJACENCY,
00392 PRIMITIVE_LINES_ADJACENCY,
00393 PRIMITIVE_TRIANGLE_STRIP_ADJACENCY,
00394 PRIMITIVE_TRIANGLES_ADJACENCY,
00395 PRIMITIVE_PATCHES,
00396 };
00397
00403 enum EHWBufferUsage
00404 {
00405 HWBUFFER_STATIC = 0,
00406 HWBUFFER_DYNAMIC,
00407 };
00408
00409
00410
00411
00412
00413
00415 struct SPrimitiveVertex
00416 {
00417 SPrimitiveVertex() :
00418 RHW (0.0f ),
00419 Color (0xFF000000 )
00420 {
00421 }
00422 SPrimitiveVertex(f32 X, f32 Y, f32 Z, const video::color &Clr, f32 U = 0.0f, f32 V = 0.0f, f32 AspectRHW = 1.0f) :
00423 Coord (X, Y, Z ),
00424 RHW (AspectRHW ),
00425 Color (Clr.getSingle()),
00426 TexCoord(U, V )
00427 {
00428 }
00429 SPrimitiveVertex(f32 X, f32 Y, f32 Z, u32 Clr, f32 U = 0.0f, f32 V = 0.0f, f32 AspectRHW = 1.0f) :
00430 Coord (X, Y, Z ),
00431 RHW (AspectRHW ),
00432 Color (Clr ),
00433 TexCoord(U, V )
00434 {
00435 }
00436
00437
00438 dim::vector3df Coord;
00439 f32 RHW;
00440 u32 Color;
00441 dim::point2df TexCoord;
00442 };
00443
00444
00445 }
00446
00447 }
00448
00449
00450 #endif
00451
00452
00453
00454