169 for (
uint i = 0;
i < num_vertex_bindings; ++
i ) {
178 gr_line(x, y, x, y, resize_mode);
183 if ( (w < 1) || (h < 1) ) {
191 float u_scale, v_scale;
205 float x1, x2, y1, y2;
206 int bw, bh, do_resize;
216 u0 = u_scale * (
i2fl(sx) /
i2fl(bw));
217 v0 = v_scale * (
i2fl(sy) /
i2fl(bh));
219 u1 = u_scale * (
i2fl(sx+w) /
i2fl(bw));
220 v1 = v_scale * (
i2fl(sy+h) /
i2fl(bh));
261 int bw, bh, do_resize;
287 if ( (dx1 > clip_right) || (dx2 < clip_left) ) {
291 if ( (dy1 > clip_bottom) || (dy2 < clip_top) ) {
295 if (dx1 < clip_left) {
296 sx += clip_left - dx1;
300 if (dy1 < clip_top) {
301 sy += clip_top - dy1;
305 if (dx2 > clip_right) {
309 if (dy2 > clip_bottom) {
339 if ( (w < 1) || (h < 1) ) {
349 Assert( w == (dx2-dx1+1) );
350 Assert( h == (dy2-dy1+1) );
357 Assert( (dx1 >= clip_left) && (dx1 <= clip_right) );
358 Assert( (dx2 >= clip_left) && (dx2 <= clip_right) );
359 Assert( (dy1 >= clip_top) && (dy1 <= clip_bottom) );
360 Assert( (dy2 >= clip_top) && (dy2 <= clip_bottom) );
390 if ( (dx1 > clip_right) || (dx2 < clip_left) ) {
394 if ( (dy1 > clip_bottom) || (dy2 < clip_top) ) {
398 if (dx1 < clip_left) {
399 sx = clip_left - dx1;
403 if (dy1 < clip_top) {
408 if (dx2 > clip_right) {
412 if (dy2 > clip_bottom) {
416 if ( (sx < 0) || (sy < 0) ) {
420 if ( (sx >= w) || (sy >=
h) ) {
428 #define MAX_VERTS_PER_DRAW 120
434 int width, spacing, letter;
439 float x1, x2, y1, y2;
440 float u_scale, v_scale;
458 int buffer_offset = 0;
489 if (sx == (
float)0x8000) {
517 if (sx == (
float)0x8000) {
537 float xd, yd, xc, yc;
541 if ( (x + width) < clip_left ) {
549 if (x > clip_right) {
553 if (y > clip_bottom) {
573 if ( (xc + wc) > clip_right ) {
574 wc = clip_right - xc;
577 if ( (yc + hc) > clip_bottom ) {
578 hc = clip_bottom - yc;
581 if ( (wc < 1) || (hc < 1) ) {
598 u0 = u_scale * (
i2fl(u+xd) / bw);
599 v0 = v_scale * (
i2fl(v+yd) / bh);
601 u1 = u_scale * (
i2fl((u+xd)+wc) / bw);
602 v1 = v_scale * (
i2fl((v+yd)+hc) / bh);
609 GL_string_render_buff[buffer_offset].
x = (
GLfloat)x1;
610 GL_string_render_buff[buffer_offset].
y = (
GLfloat)y1;
611 GL_string_render_buff[buffer_offset].
u = u0;
612 GL_string_render_buff[buffer_offset].
v =
v0;
615 GL_string_render_buff[buffer_offset].
x = (
GLfloat)x1;
616 GL_string_render_buff[buffer_offset].
y = (
GLfloat)y2;
617 GL_string_render_buff[buffer_offset].
u = u0;
618 GL_string_render_buff[buffer_offset].
v =
v1;
621 GL_string_render_buff[buffer_offset].
x = (
GLfloat)x2;
622 GL_string_render_buff[buffer_offset].
y = (
GLfloat)y1;
623 GL_string_render_buff[buffer_offset].
u =
u1;
624 GL_string_render_buff[buffer_offset].
v =
v0;
627 GL_string_render_buff[buffer_offset].
x = (
GLfloat)x1;
628 GL_string_render_buff[buffer_offset].
y = (
GLfloat)y2;
629 GL_string_render_buff[buffer_offset].
u = u0;
630 GL_string_render_buff[buffer_offset].
v =
v1;
633 GL_string_render_buff[buffer_offset].
x = (
GLfloat)x2;
634 GL_string_render_buff[buffer_offset].
y = (
GLfloat)y1;
635 GL_string_render_buff[buffer_offset].
u =
u1;
636 GL_string_render_buff[buffer_offset].
v =
v0;
639 GL_string_render_buff[buffer_offset].
x = (
GLfloat)x2;
640 GL_string_render_buff[buffer_offset].
y = (
GLfloat)y2;
641 GL_string_render_buff[buffer_offset].
u =
u1;
642 GL_string_render_buff[buffer_offset].
v =
v1;
646 if ( buffer_offset ) {
680 INT_CLIPLINE(x1, y1, x2, y2, clip_left, clip_top, clip_right, clip_bottom,
return, ;, ;);
682 sx1 =
i2fl(x1 + offset_x);
683 sy1 =
i2fl(y1 + offset_y);
684 sx2 =
i2fl(x2 + offset_x);
685 sy2 =
i2fl(y2 + offset_y);
697 if ( (x1 == x2) && (y1 == y2) ) {
700 GLfloat vert[3]= {sx1, sy1, -0.99f};
724 }
else if (y1 == y2) {
774 start->
xyz.x, start->
xyz.y, start->
xyz.z,
808 FL_CLIPLINE(x1, y1, x2, y2, (
float)
gr_screen.
clip_left, (
float)
gr_screen.
clip_top, (
float)
gr_screen.
clip_right, (
float)
gr_screen.
clip_bottom,
return, ;, ;);
819 if ( (x1 == x2) && (y1 == y2) ) {
824 GLfloat vert[3]= {sx1, sy1, -0.99f};
847 }
else if (y1 == y2) {
892 INT_CLIPLINE(x1, y1, x2, y2,
gr_screen.
clip_left,
gr_screen.
clip_top,
gr_screen.
clip_right,
gr_screen.
clip_bottom,
return, ;, swapped = 1);
901 float sx1, sy1, sx2, sy2;
914 }
else if (y1 == y2) {
950 int segments = 4 + (
int)(r);
951 float theta = 2 *
PI /
float(segments - 1);
952 float c = cosf(theta);
953 float s = sinf(theta);
964 float halflinewidth = linewidth / 2.0f;
965 float inner_rad = r - halflinewidth;
966 float outer_rad = r + halflinewidth;
1001 for (
int i=0;
i < segments * 4;
i+=4) {
1002 circle[
i] =
i2fl(xc + (x2 * outer_rad) + offset_x);
1003 circle[
i+1] =
i2fl(yc + (y2 * outer_rad) + offset_y);
1005 circle[
i+2] =
i2fl(xc + (x2 * inner_rad) + offset_x);
1006 circle[
i+3] =
i2fl(yc + (y2 * inner_rad) + offset_y);
1009 x2 = c * x1 - s * y1;
1010 y2 = s * t + c * y1;
1035 void gr_opengl_arc(
int xc,
int yc,
float r,
float angle_start,
float angle_end,
bool fill,
int resize_mode)
1038 if (angle_end < angle_start) {
1039 float temp = angle_start;
1040 angle_start = angle_end;
1044 float arc_length_ratio;
1045 arc_length_ratio =
MIN(angle_end - angle_start, 360.0
f) / 360.0f;
1047 int segments = 4 + (
int)(r * arc_length_ratio);
1048 float theta = 2 *
PI /
float(segments - 1) * arc_length_ratio;
1049 float c = cosf(theta);
1050 float s = sinf(theta);
1058 float halflinewidth = 0.0f;
1059 float inner_rad = 0.0f;
1060 float outer_rad =
r;
1066 halflinewidth = linewidth / 2.0f;
1067 inner_rad = r - halflinewidth;
1068 outer_rad = r + halflinewidth;
1108 arc =
new GLfloat[segments * 2 + 2];
1113 for (
int i=2;
i < segments * 2 + 2;
i+=2) {
1114 arc[
i] =
i2fl(xc + (x2 * outer_rad) + offset_x);
1115 arc[
i+1] =
i2fl(yc + (y2 * outer_rad) + offset_y);
1118 x2 = c * x1 - s * y1;
1119 y2 = s * t + c * y1;
1131 arc =
new GLfloat[segments * 4];
1133 for (
int i=0;
i < segments * 4;
i+=4) {
1134 arc[
i] =
i2fl(xc + (x2 * outer_rad) + offset_x);
1135 arc[
i+1] =
i2fl(yc + (y2 * outer_rad) + offset_y);
1137 arc[
i+2] =
i2fl(xc + (x2 * inner_rad) + offset_x);
1138 arc[
i+3] =
i2fl(yc + (y2 * inner_rad) + offset_y);
1141 x2 = c * x1 - s * y1;
1142 y2 = s * t + c * y1;
1182 switch (direction) {
1196 p += ((a -
b) << 2) + 10;
1218 p += ((a -
b) << 2) + 10;
1240 p += ((a -
b) << 2) + 10;
1260 p += ((a -
b) << 2) + 10;
1278 float sx, sy, sz, sw;
1281 bool isNebula =
false;
1282 bool isRamp =
false;
1313 for (i = (nv - 1), j = 0; i >= 0; i--, j++) {
1319 sz = (1.0f - 1.0f / (1.0f + va->
world.
xyz.z / 32768.0f));
1342 if (override_primary) {
1354 }
else if (isRamp) {
1355 vertCol[j].
r = va->
b;
1356 vertCol[j].
g = va->
b;
1357 vertCol[j].
b = va->
b;
1360 vertCol[j].
r = va->
r;
1361 vertCol[j].
g = va->
g;
1362 vertCol[j].
b = va->
b;
1389 if(flags & (TMAP_FLAG_NEBULA | TMAP_FLAG_GOURAUD)) {
1406 float u_scale = 1.0f, v_scale = 1.0f;
1438 for (i = (nv - 1); i >= 0; i--) {
1479 float u_scale = 1.0f, v_scale = 1.0f;
1521 colour.reserve(nv * 4);
1523 vertvec.reserve(nv * 3);
1524 uvcoords.reserve(nv * 2);
1526 for (
int i = 0;
i < nv;
i++) {
1530 colour.push_back(va->
r);
1531 colour.push_back(va->
g);
1532 colour.push_back(va->
b);
1533 colour.push_back((
ubyte) alpha);
1539 vertvec.push_back(va->
world.
xyz.x);
1540 vertvec.push_back(va->
world.
xyz.y);
1541 vertvec.push_back(va->
world.
xyz.z);
1576 float u_scale = 1.0f, v_scale = 1.0f;
1578 bool texture_matrix_set =
false;
1606 if ( (u_scale != 1.0
f) || (v_scale != 1.0
f) ) {
1614 texture_matrix_set =
true;
1631 float offset_z = -0.99f;
1648 if (texture_matrix_set) {
1662 float u_scale = 1.0f, v_scale = 1.0f;
1722 float u_scale = 1.0f, v_scale = 1.0f;
1809 #define FIND_SCALED_NUM(x, x0, x1, y0, y1) ( ((((x) - (x0)) * ((y1) - (y0))) / ((x1) - (x0))) + (y0) )
1813 float x0, y0, x1, y1;
1815 float clipped_x0, clipped_y0, clipped_x1, clipped_y1;
1816 float clipped_u0, clipped_v0, clipped_u1, clipped_v1;
1817 float xmin, xmax, ymin, ymax;
1818 int dx0, dy0, dx1, dy1;
1834 if ( (y1 <= y0) || (x1 <= x0) ) {
1838 if ( (x1 < xmin ) || (x0 > xmax) ) {
1842 if ( (y1 < ymin ) || (y0 > ymax) ) {
1880 dx0 =
fl2i(clipped_x0);
1881 dx1 =
fl2i(clipped_x1);
1882 dy0 =
fl2i(clipped_y0);
1883 dy1 =
fl2i(clipped_y1);
1885 if ( (dx1 <= dx0) || (dy1 <= dy0) ) {
1992 if ( !(r || g || b) ) {
2016 if ( !(r || g || b || a) ) {
2041 if ( (w < 1) || (h < 1) ) {
2045 float u_scale, v_scale;
2047 float x1, x2, y1, y2;
2048 int bw, bh, do_resize;
2066 u0 = u_scale * (
i2fl(sx) /
i2fl(bw));
2067 v0 = v_scale * (
i2fl(sy) /
i2fl(bh));
2069 u1 = u_scale * (
i2fl(sx+w) /
i2fl(bw));
2070 v1 = v_scale * (
i2fl(sy+h) /
i2fl(bh));
2097 int dx2 = x + w - 1;
2099 int dy2 = y + h - 1;
2101 int bw, bh, do_resize;
2127 if ( (dx1 > clip_right) || (dx2 < clip_left) ) {
2131 if ( (dy1 > clip_bottom) || (dy2 < clip_top) ) {
2135 if ( dx1 < clip_left ) {
2136 sx += clip_left-dx1;
2140 if ( dy1 < clip_top ) {
2145 if ( dx2 > clip_right ) {
2149 if ( dy2 > clip_bottom ) {
2168 if ( (sx + w) > bw ) {
2173 if ( (sy + h) > bh ) {
2178 if ( (w < 1) || (h < 1) ) {
2188 Assert( w == (dx2 - dx1 + 1) );
2189 Assert( h == (dy2 - dy1 + 1) );
2192 Assert( (sx + w) <= bw );
2193 Assert( (sy + h) <= bh );
2196 Assert( (dx1 >= clip_left) && (dx1 <= clip_right) );
2197 Assert( (dx2 >= clip_left) && (dx2 <= clip_right) );
2198 Assert( (dy1 >= clip_top) && (dy1 <= clip_bottom) );
2199 Assert( (dy2 >= clip_top) && (dy2 <= clip_bottom) );
2249 GLUquadricObj *quad = NULL;
2253 quad = gluNewQuadric();
2269 gluQuadricCallback(quad, GLU_ERROR, NULL);
2272 gluQuadricDrawStyle(quad, GLU_FILL);
2275 gluQuadricNormals(quad, GLU_NONE);
2278 gluSphere(quad, (
GLdouble)rad, 16, 16);
2281 gluDeleteQuadric(quad);
2286 unsigned int nVertex = (rings + 1) * (segments+1) * 3;
2288 float *Vertices = (
float*)
vm_malloc(
sizeof(
float) * nVertex);
2289 float *pVertex = Vertices;
2291 ushort *pIndex = Indices;
2293 float fDeltaRingAngle = (
PI / rings);
2294 float fDeltaSegAngle = (2.0f *
PI / segments);
2295 unsigned short wVerticeIndex = 0 ;
2298 for(
int ring = 0; ring <= rings; ring++ ) {
2299 float r0 = sinf (ring * fDeltaRingAngle);
2300 float y0 = cosf (ring * fDeltaRingAngle);
2303 for(
int seg = 0; seg <= segments; seg++) {
2304 float x0 = r0 * sinf(seg * fDeltaSegAngle);
2305 float z0 = r0 * cosf(seg * fDeltaSegAngle);
2312 if (ring != rings) {
2314 *pIndex++ = wVerticeIndex + (
ushort)segments + 1;
2315 *pIndex++ = wVerticeIndex;
2316 *pIndex++ = wVerticeIndex + (
ushort)segments;
2317 *pIndex++ = wVerticeIndex + (
ushort)segments + 1;
2318 *pIndex++ = wVerticeIndex + 1;
2319 *pIndex++ = wVerticeIndex;
2397 unsigned int nVertex = (segments + 1) * 2 * 3 + 6;
2399 float *Vertices = (
float*)
vm_malloc(
sizeof(
float) * nVertex);
2400 float *pVertex = Vertices;
2402 ushort *pIndex = Indices;
2404 float fDeltaSegAngle = (2.0f *
PI / segments);
2405 unsigned short wVerticeIndex = 0 ;
2416 for(
int ring = 0; ring <= 1; ring++ ) {
2417 float z0 = (
float)ring;
2420 for(
int seg = 0; seg <= segments; seg++) {
2421 float x0 = sinf(seg * fDeltaSegAngle);
2422 float y0 = cosf(seg * fDeltaSegAngle);
2430 *pIndex++ = wVerticeIndex + (
ushort)segments + 1;
2431 *pIndex++ = wVerticeIndex;
2432 *pIndex++ = wVerticeIndex + (
ushort)segments;
2433 *pIndex++ = wVerticeIndex + (
ushort)segments + 1;
2434 *pIndex++ = wVerticeIndex + 1;
2435 *pIndex++ = wVerticeIndex;
2438 *pIndex++ = wVerticeIndex + 1;
2439 *pIndex++ = wVerticeIndex;
2448 *pIndex++ = wVerticeIndex + 1;
2449 *pIndex++ = wVerticeIndex;
2993 0.0f, Scene_texture_v_scale
3132 light *l = &lights_copy[
i];
3218 0.0f, Scene_texture_v_scale
3310 colours.reserve(33 * 4);
3311 distortion_vertex.reserve(33 * 2);
3312 for(
int i = 0;
i < 33;
i++)
3314 colours.push_back((
ubyte) rand()%256);
3315 colours.push_back((
ubyte) rand()%256);
3316 colours.push_back(255);
3317 colours.push_back(255);
3319 distortion_vertex.push_back(0.04
f);
void gr_opengl_shade(int x, int y, int w, int h, int resize_mode)
void EnableVertexAttrib(GLuint index)
#define TMAP_FLAG_PIXEL_FOG
#define GL_COLOR_ATTACHMENT1_EXT
void opengl_bind_vertex_component(vertex_format_data &vert_component)
bool gr_resize_screen_posf(float *x, float *y, float *w, float *h, int resize_mode)
struct screen3d::@234::@236 xyw
bool light_compare_by_type(const light &a, const light &b)
#define OGL_EXT_FRAMEBUFFER_OBJECT
void gr_opengl_copy_effect_texture()
#define GL_DEPTH24_STENCIL8_EXT
void gr_opengl_aaline(vertex *v1, vertex *v2)
#define TMAP_FLAG_SOFT_QUAD
void gr_opengl_draw_deferred_light_cylinder(vec3d *position, matrix *orient, float rad, float length, bool clearStencil=true)
#define GL_ELEMENT_ARRAY_BUFFER_ARB
WINGDIAPI void APIENTRY glDrawArrays(GLenum mode, GLint first, GLsizei count)
GLfloat GLfloat GLfloat GLfloat h
void VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLvoid *pointer)
#define gr_post_process_end
float vm_vec_mag(const vec3d *v)
#define gr_end_view_matrix
int opengl_check_framebuffer()
#define vglBindFramebufferEXT
void opengl_tmapper_internal3d(int nv, vertex **verts, uint flags)
void opengl_setup_render_states(int &r, int &g, int &b, int &alpha, int &tmap_type, int flags, int is_scaler)
int get_char_width(ubyte c1, ubyte c2, int *width, int *spacing)
void Color(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha=255)
void SetTextureSource(gr_texture_source ts)
GLuint Scene_luminance_texture
GLuint deferred_light_sphere_icount
GLuint deferred_light_cylinder_vbo
WINGDIAPI void APIENTRY glMatrixMode(GLenum mode)
WINGDIAPI void APIENTRY glDisable(GLenum cap)
void gr_opengl_set_2d_matrix()
WINGDIAPI void APIENTRY glClear(GLbitfield mask)
WINGDIAPI void APIENTRY glDeleteTextures(GLsizei n, const GLuint *textures)
GLint GLint GLsizei GLsizei GLsizei depth
int Cmdline_softparticles
void opengl_draw_textured_quad(GLfloat x1, GLfloat y1, GLfloat u1, GLfloat v1, GLfloat x2, GLfloat y2, GLfloat u2, GLfloat v2)
GLboolean DepthTest(GLint state=-1)
GLuint Cockpit_depth_texture
void gr_opengl_update_distortion()
#define GL_COLOR_ATTACHMENT4_EXT
int bm_get_info(int handle, int *w, int *h, ubyte *flags, int *nframes, int *fps)
Gets info on the bitmap indexed by handle.
void opengl_clear_deferred_buffers()
GLuint opengl_get_rtt_framebuffer()
Gets the current RTT framebuffer.
WINGDIAPI void APIENTRY glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
struct vec3d::@225::@227 xyz
#define TMAP_HTL_3D_UNLIT
void SetZbufferType(gr_zbuffer_type zt)
void BindElementBuffer(GLuint id)
void gr_opengl_aabitmap(int x, int y, int resize_mode, bool mirror)
bool Cmdline_fb_explosions
void EnableClientNormal()
void gr_opengl_deferred_light_cylinder_init(int segments)
void gr_opengl_cross_fade(int bmap1, int bmap2, int x1, int y1, int x2, int y2, float pct, int resize_mode)
#define TMAP_FLAG_QUADSTRIP
opengl_texture_state Texture
void EnableClientTexture()
GLboolean CullFace(GLint state=-1)
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
void gr_opengl_sphere_htl(float rad)
bool PostProcessing_override
void gr_opengl_deferred_light_sphere_init(int rings, int segments)
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
GLfloat GLfloat GLfloat v2
WINGDIAPI void APIENTRY glEnable(GLenum cap)
#define TMAP_FLAG_DISTORTION
#define vglGenRenderbuffersEXT
#define TMAP_FLAG_BW_TEXTURE
#define GL_TEXTURE_WRAP_S
uint get_num_vertex_components()
GLint opengl_shader_get_attribute(const char *attribute_text)
#define gr_end_proj_matrix
WINGDIAPI void APIENTRY glPopMatrix(void)
#define vglFramebufferRenderbufferEXT
void opengl_draw_primitive(int nv, vertex **verts, uint flags, float u_scale, float v_scale, int r, int g, int b, int a, int override_primary=0)
#define GL_STENCIL_ATTACHMENT
#define CLAMP(x, min, max)
#define vglFramebufferTexture2DEXT
void opengl_draw(vertex_layout vertex_binding, GLenum prim_type, int count, int vbuffer_handle)
void g3_done_instance(bool set_api=false)
GLuint Distortion_texture[2]
#define GL_DEPTH_ATTACHMENT_EXT
GLuint Scene_position_texture
#define gr_set_view_matrix
void gr_opengl_flash_alpha(int r, int g, int b, int a)
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
void gr_opengl_line(int x1, int y1, int x2, int y2, int resize_mode)
matrix * vm_vector_2_matrix(matrix *m, const vec3d *fvec, const vec3d *uvec, const vec3d *rvec)
void opengl_tnl_set_material_soft_particle(uint flags)
void opengl_tmapper_internal(int nv, vertex **verts, uint flags, int is_scaler=0)
#define GR_ALPHABLEND_FILTER
GLboolean DepthMask(GLint state=-1)
#define gr_set_proj_matrix
void opengl_draw_coloured_quad(GLint x1, GLint y1, GLint x2, GLint y2)
float static_light_factor
GLdouble GLdouble GLdouble r
void gr_opengl_scene_texture_begin()
void add_vertex_component(vertex_format_data::vertex_format format_type, uint stride, void *src)
#define vglBindRenderbufferEXT
#define TMAP_FLAG_GOURAUD
#define GL_DEPTH_ATTACHMENT
#define vglBlitFramebufferEXT
void gr_opengl_deferred_lighting_finish()
#define vglDeleteBuffersARB
void gr_opengl_deferred_lighting_end()
GLboolean GLboolean GLboolean GLboolean a
int Scene_texture_initialized
bool GL_rendering_to_texture
int GLOWMAP
References a map that is a fully lit version of its index -Bobboau.
#define GL_FRAMEBUFFER_EXT
void opengl_aabitmap_ex_internal(int x, int y, int w, int h, int sx, int sy, int resize_mode, bool mirror)
#define TCACHE_TYPE_INTERFACE
WINGDIAPI void APIENTRY glGenTextures(GLsizei n, GLuint *textures)
#define GL_DEPTH_COMPONENT24
int vm_vec_dist_to_line(const vec3d *p, const vec3d *l0, const vec3d *l1, vec3d *nearest, float *dist)
void SetAlphaBlendMode(gr_alpha_blend ab)
void gr_opengl_unfilled_circle(int xc, int yc, int d, int resize_mode)
void gr_opengl_pixel(int x, int y, int resize_mode)
vertex_format_data * get_vertex_component(uint index)
void VertexPointer(GLint size, GLenum type, GLsizei stride, GLvoid *pointer)
#define vglDrawRangeElements
WINGDIAPI void APIENTRY glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
GLuint Scene_specular_texture
void gr_opengl_string(float sx, float sy, const char *s, int resize_mode)
#define GL_TEXTURE_WRAP_R
#define GL_CHECK_FOR_ERRORS(s)
void gr_opengl_circle(int xc, int yc, int d, int resize_mode)
GLuint deferred_light_cylinder_icount
GLuint Scene_color_texture
void TexPointer(GLint size, GLenum type, GLsizei stride, GLvoid *pointer)
#define GL_TEXTURE_MAG_FILTER
opengl_uniform_state Uniform
void gr_opengl_end_2d_matrix()
#define Is_Extension_Enabled(x)
void SetTarget(GLenum tex_target)
WINGDIAPI void APIENTRY glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
#define GL_COLOR_ATTACHMENT3_EXT
GLuint Distortion_framebuffer
int Cmdline_no_deferred_lighting
GLint GLint GLint GLint GLint x
GLuint deferred_light_cylinder_ibo
void Enable(GLuint tex_id=0)
WINGDIAPI void APIENTRY glDrawBuffer(GLenum mode)
void gr_opengl_aabitmap_ex(int x, int y, int w, int h, int sx, int sy, int resize_mode, bool mirror)
void NormalPointer(GLenum type, GLsizei stride, GLvoid *pointer)
GLuint deferred_light_sphere_ibo
WINGDIAPI void APIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
void opengl_tnl_set_material_distortion(uint flags)
void gr_opengl_flash(int r, int g, int b)
GLboolean Blend(GLint state=-1)
int get_centered_x(const char *s, bool scaled)
#define TMAP_FLAG_CORRECT
void ColorPointer(GLint size, GLenum type, GLsizei stride, GLvoid *pointer)
#define FIND_SCALED_NUM(x, x0, x1, y0, y1)
#define GL_DEPTH_TEXTURE_MODE
#define GL_UNSIGNED_INT_8_8_8_8_REV
#define GL_STATIC_DRAW_ARB
void gr_opengl_render_effect(int nverts, vertex *verts, float *radius_list, uint flags)
void BindArrayBuffer(GLuint id)
__inline void gr_line(int x1, int y1, int x2, int y2, int resize_mode=GR_RESIZE_FULL)
GLuint deferred_light_sphere_vbo
bool Scene_framebuffer_in_frame
void vm_vec_sub(vec3d *dest, const vec3d *src0, const vec3d *src1)
GLuint Scene_normal_texture
GLfloat Scene_texture_u_scale
void gr_opengl_tmapper(int nverts, vertex **verts, uint flags)
GLboolean GLboolean GLboolean b
__inline void gr_fog_set(int fog_mode, int r, int g, int b, float fog_near=-1.0f, float fog_far=-1.0f)
bool gr_resize_screen_pos(int *x, int *y, int *w, int *h, int resize_mode)
void opengl_set_additive_tex_env()
void opengl_setup_scene_textures()
#define TMAP_FLAG_TRILIST
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
WINGDIAPI void APIENTRY glStencilMask(GLuint mask)
#define GL_TEXTURE_WRAP_T
void EnableClientVertex()
void gr_opengl_deferred_lighting_begin()
WINGDIAPI void APIENTRY glGetFloatv(GLenum pname, GLfloat *params)
#define GL_ARRAY_BUFFER_ARB
int gr_opengl_maybe_create_shader(shader_type shader_t, unsigned int flags)
GLuint Scene_stencil_buffer
GLushort deferred_light_sphere_vcount
GLubyte GLubyte GLubyte GLubyte w
#define GL_COLOR_ATTACHMENT0
#define FL_CLIPLINE(x1, y1, x2, y2, XMIN, YMIN, XMAX, YMAX, WHEN_OUTSIDE, WHEN_CLIPPED, WHEN_SWAPPED)
float static_point_factor
#define vglGenFramebuffersEXT
#define GL_TEXTURE_COMPARE_MODE
WINGDIAPI void APIENTRY glPushMatrix(void)
GLfloat Scene_texture_v_scale
#define vglRenderbufferStorageEXT
opengl_vertex_bind::type binding_type
#define vglDeleteFramebuffersEXT
#define GL_TEXTURE_MIN_FILTER
void gr_opengl_line_htl(const vec3d *start, const vec3d *end)
GLushort deferred_light_cylinder_vcount
void gr_opengl_scaler(vertex *va, vertex *vb, bool bw_bitmap=false)
GLuint Scene_depth_texture
GLuint Scene_effect_texture
#define OGL_ARB_TEXTURE_NON_POWER_OF_TWO
void g3_start_instance_matrix(const vec3d *pos, const matrix *orient, bool set_api=true)
#define TMAP_FLAG_TEXTURED
GLint GL_max_renderbuffer_size
void neb2_get_pixel(int x, int y, int *r, int *g, int *b)
void opengl_scene_texture_shutdown()
GLenum GLuint GLenum GLsizei length
#define TMAP_FLAG_TRISTRIP
void opengl_render_internal3d(int nverts, vertex *verts, uint flags)
void SetActiveClientUnit(GLuint id)
void gr_bitmap(int _x, int _y, int resize_mode)
WINGDIAPI void APIENTRY glScalef(GLfloat x, GLfloat y, GLfloat z)
#define GR_BITBLT_MODE_NORMAL
int gr_opengl_tcache_set(int bitmap_handle, int bitmap_type, float *u_scale, float *v_scale, int stage)
WINGDIAPI void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param)
void opengl_bitmap_ex_internal(int x, int y, int w, int h, int sx, int sy, int resize_mode)
#define GL_DEPTH_COMPONENT
bool is_minimum_GLSL_version()
#define GL_UNSIGNED_SHORT
#define TMAP_FLAG_DISTORTION_THRUSTER
void opengl_shader_set_current(opengl_shader_t *shader_obj)
WINGDIAPI void APIENTRY glTranslatef(GLfloat x, GLfloat y, GLfloat z)
void gr_opengl_arc(int xc, int yc, float r, float angle_start, float angle_end, bool fill, int resize_mode)
GLclampf GLclampf GLclampf alpha
#define TMAP_FLAG_QUADLIST
#define INT_CLIPLINE(x1, y1, x2, y2, XMIN, YMIN, XMAX, YMAX, WHEN_OUTSIDE, WHEN_CLIPPED, WHEN_SWAPPED)
#define GL_COLOR_BUFFER_BIT
void gr_opengl_gradient(int x1, int y1, int x2, int y2, int resize_mode)
#define GL_COLOR_ATTACHMENT2_EXT
#define MAX_VERTS_PER_DRAW
vertex_format_data::vertex_format format
WINGDIAPI GLenum APIENTRY glGetError(void)
void opengl_bind_vertex_layout(vertex_layout &layout)
void opengl_render_internal(int nverts, vertex *verts, uint flags)
matrix vmd_identity_matrix
void gr_opengl_scene_texture_end()
#define GL_STENCIL_BUFFER_BIT
void gr_opengl_draw_deferred_light_sphere(vec3d *position, float rad, bool clearStencil=true)
void SetActiveUnit(GLuint id=0)
#define GL_COLOR_ATTACHMENT0_EXT
bool Use_Shaders_for_effect_rendering
int opengl_check_for_errors(char *err_at)
void gr_opengl_draw_line_list(const colored_vector *lines, int num)
WINGDIAPI void APIENTRY glStencilFunc(GLenum func, GLint ref, GLuint mask)
void gr_opengl_curve(int xc, int yc, int r, int direction, int resize_mode)
#define GL_DEPTH_BUFFER_BIT
WINGDIAPI void APIENTRY glReadBuffer(GLenum mode)
#define TCACHE_TYPE_AABITMAP
GLboolean Lighting(GLint state=-1)
#define GL_TRIANGLE_STRIP
void gr_opengl_bitmap_ex(int x, int y, int w, int h, int sx, int sy, int resize_mode)
void gr_opengl_render(int nverts, vertex *verts, uint flags)