X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fgaw%2Fgaw_gl.c;h=1868d26d6d3976d093d80cead326e6a2e59515a2;hb=208078d05078a27b5cdfc213031d91e88180994b;hp=7a58c1db9d90b263fe17bb8f84412f45fc6b9dd9;hpb=176092843ec9bc851c73c842facf92ad48ab03cb;p=retroray diff --git a/src/gaw/gaw_gl.c b/src/gaw/gaw_gl.c index 7a58c1d..1868d26 100644 --- a/src/gaw/gaw_gl.c +++ b/src/gaw/gaw_gl.c @@ -1,5 +1,5 @@ /* -Deep Runner - 6dof shooter game for the SGI O2. +RetroRay - integrated standalone vintage modeller/renderer Copyright (C) 2023 John Tsiombikas This program is free software: you can redistribute it and/or modify @@ -44,6 +44,11 @@ void gaw_viewport(int x, int y, int w, int h) glViewport(x, y, w, h); } +void gaw_get_viewport(int *vp) +{ + glGetIntegerv(GL_VIEWPORT, vp); +} + void gaw_matrix_mode(int mode) { mode += GL_MODELVIEW; @@ -167,6 +172,9 @@ void gaw_enable(int st) case GAW_TEXTURE_2D: glEnable(GL_TEXTURE_2D); break; + case GAW_POLYGON_OFFSET: + glEnable(GL_POLYGON_OFFSET_FILL); + break; default: break; } @@ -214,6 +222,9 @@ void gaw_disable(int st) case GAW_TEXTURE_2D: glDisable(GL_TEXTURE_2D); break; + case GAW_POLYGON_OFFSET: + glDisable(GL_POLYGON_OFFSET_FILL); + break; default: break; } @@ -235,6 +246,11 @@ void gaw_alpha_func(int func, float ref) glAlphaFunc(func + GL_NEVER, ref); } +void gaw_zoffset(float offs) +{ + glPolygonOffset(1, offs); +} + void gaw_clear_color(float r, float g, float b, float a) { glClearColor(r, g, b, a); @@ -389,6 +405,11 @@ void gaw_vertex3f(float x, float y, float z) glVertex3f(x, y, z); } +void gaw_vertex4f(float x, float y, float z, float w) +{ + glVertex4f(x, y, z, w); +} + void gaw_rect(float x1, float y1, float x2, float y2) { glRectf(x1, y1, x2, y2);