2 This file is part of the 3dengfx, realtime visualization system.
4 Copyright (c) 2004, 2005 John Tsiombikas <nuclear@siggraph.org>
6 3dengfx is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 3dengfx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with 3dengfx; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 /* enumerations and data structures for the low-level 3dengfx state
23 * Author: John Tsiombikas 2004
26 #ifndef _3DENGINEFX_TYPES_HPP_
27 #define _3DENGINEFX_TYPES_HPP_
30 #include "n3dmath2/n3dmath2_types.hpp"
33 SHADING_FLAT = GL_FLAT,
34 SHADING_GOURAUD = GL_SMOOTH
38 enum FaceOrder {ORDER_CW = GL_CW, ORDER_CCW = GL_CCW};
40 enum FaceOrder {ORDER_CW = GL_CCW, ORDER_CCW = GL_CW};
44 TRIANGLE_LIST = GL_TRIANGLES,
45 TRIANGLE_STRIP = GL_TRIANGLE_STRIP,
46 TRIANGLE_FAN = GL_TRIANGLE_FAN,
48 LINE_STRIP = GL_LINE_STRIP,
49 LINE_LOOP = GL_LINE_LOOP,
50 POINT_LIST = GL_POINTS,
52 QUAD_STRIP = GL_QUAD_STRIP
58 BLEND_SRC_COLOR = GL_SRC_COLOR,
59 BLEND_ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR,
60 BLEND_SRC_ALPHA = GL_SRC_ALPHA,
61 BLEND_ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA,
62 BLEND_ONE_MINUS_DST_COLOR = GL_ONE_MINUS_DST_COLOR
65 enum TextureBlendFunction {
66 TOP_REPLACE = GL_REPLACE,
68 TOP_ADDSIGNED = GL_ADD_SIGNED,
69 TOP_SUBTRACT = GL_SUBTRACT,
70 TOP_MODULATE = GL_MODULATE,
71 TOP_LERP = GL_INTERPOLATE,
72 TOP_DOT3 = GL_DOT3_RGB,
73 TOP_DOT3_RGBA = GL_DOT3_RGBA
76 enum TextureBlendArgument {
77 TARG_TEXTURE = GL_TEXTURE,
78 TARG_CONSTANT = GL_CONSTANT,
79 TARG_COLOR = GL_PRIMARY_COLOR,
80 TARG_PREV = GL_PREVIOUS,
88 CMP_LEQUAL = GL_LEQUAL,
89 CMP_GREATER = GL_GREATER,
90 CMP_NOTEQUAL = GL_NOTEQUAL,
91 CMP_GEQUAL = GL_GEQUAL,
92 CMP_ALWAYS = GL_ALWAYS
98 SOP_REPLACE = GL_REPLACE,
100 SOP_DECSAT = GL_DECR,
101 SOP_INVERT = GL_INVERT,
102 SOP_INC = GL_INCR, // TODO: find a way to let these wrap around
106 enum TextureFilteringType {
110 ANISOTROPIC_FILTERING
113 enum TextureAddressing {
114 TEXADDR_WRAP = GL_REPEAT,
115 //TexAddrMirror = D3DTADDRESS_MIRROR,
116 TEXADDR_CLAMP = GL_CLAMP_TO_EDGE,
117 TEXADDR_CLAMP_BORDER = GL_CLAMP
118 //TexAddrMirrorOnce = D3DTADDRESS_MIRRORONCE
122 TEX_1D = GL_TEXTURE_1D,
123 TEX_2D = GL_TEXTURE_2D,
124 TEX_3D = GL_TEXTURE_3D,
125 TEX_CUBE = GL_TEXTURE_CUBE_MAP
129 CUBE_MAP_PX = GL_TEXTURE_CUBE_MAP_POSITIVE_X,
130 CUBE_MAP_NX = GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
131 CUBE_MAP_PY = GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
132 CUBE_MAP_NY = GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
133 CUBE_MAP_PZ = GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
134 CUBE_MAP_NZ = GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
139 #define DONT_CARE_BPP 1 // 0001
140 #define DONT_CARE_DEPTH 2 // 0010
141 #define DONT_CARE_STENCIL 4 // 0100
143 struct GraphicsInitParameters {
149 unsigned short dont_care_flags;
154 bool asm_pixel, asm_vertex;
156 bool glsl_pixel, glsl_vertex;
163 bool tex_combine_ops;
171 int max_texture_units;
172 bool non_power_of_two_textures;
187 #endif // _3DENGINEFX_TYPES_HPP_