diff options
Diffstat (limited to 'src/render/draw.cc')
-rw-r--r-- | src/render/draw.cc | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc index dea0c6b..59f4a59 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -91,7 +91,7 @@ void pass_prepare(float seconds) zone_ambient[i] = core::localplayer()->zone()->ambient_color()[i]; } zone_ambient[3] = 1.0f; - glLightModelfv(GL_LIGHT_MODEL_AMBIENT, zone_ambient); + gl::lightmodel(GL_LIGHT_MODEL_AMBIENT, zone_ambient); // zone light sources for (core::Zone::Content::iterator it = zone->content().begin(); it != zone->content().end(); it++) { @@ -249,13 +249,13 @@ void draw_globe_corona(const math::Vector3f location, const math::Color & color, gl::color(drawcolor); gl::begin(gl::Quads); - glTexCoord2f(0, 1); + gl::texcoord(0, 1); gl::vertex((Camera::axis().up() - Camera::axis().left()) * radius * 4.0f); - glTexCoord2f(0, 0); + gl::texcoord(0, 0); gl::vertex((Camera::axis().up() + Camera::axis().left()) * radius * 4.0f); - glTexCoord2f(1, 0); + gl::texcoord(1, 0); gl::vertex((Camera::axis().up() * -1 + Camera::axis().left()) * radius * 4.0f); - glTexCoord2f(1, 1); + gl::texcoord(1, 1); gl::vertex((Camera::axis().up() * -1 - Camera::axis().left()) * radius * 4.0f); gl::end(); @@ -272,7 +272,7 @@ void draw_pass_globes() { // FIXME is this ever reset ? GLfloat globe_specular[] = { 0.25f, 0.25f, 0.25f, 1.0f }; - glMaterialfv(GL_FRONT, GL_SPECULAR, globe_specular); + gl::material(GL_FRONT, GL_SPECULAR, globe_specular); // Globes have to be rendered distance sorted, closest last. // Globes behind farplane are rescaled and repositioned. @@ -852,13 +852,13 @@ void draw_model_lights(model::Model *model, const float scale, // draw the quad gl::color(color); - glTexCoord2f(1, 0); + gl::texcoord(1, 0); gl::vertex(location + (Camera::axis().up() - Camera::axis().left()) * light_size); - glTexCoord2f(0, 0); + gl::texcoord(0, 0); gl::vertex(location + (Camera::axis().up() + Camera::axis().left()) * light_size); - glTexCoord2f(0, 1); + gl::texcoord(0, 1); gl::vertex(location + (Camera::axis().up() * -1 + Camera::axis().left()) * light_size); - glTexCoord2f(1, 1); + gl::texcoord(1, 1); gl::vertex(location + (Camera::axis().up() * -1 - Camera::axis().left()) * light_size); Stats::quads++; @@ -946,13 +946,13 @@ void draw_model_lights(model::Model *model, const float scale, // draw the quad gl::color(color); - glTexCoord2f(1, 0); + gl::texcoord(1, 0); gl::vertex(location + (flare_axis.up() + flare_axis.left()) * light_size); - glTexCoord2f(0, 0); + gl::texcoord(0, 0); gl::vertex(location + (flare_axis.up() - flare_axis.left()) * light_size); - glTexCoord2f(0, 1); + gl::texcoord(0, 1); gl::vertex(location + (flare_axis.up() * -1 - flare_axis.left()) * light_size); - glTexCoord2f(1, 1); + gl::texcoord(1, 1); gl::vertex(location + (flare_axis.up() * -1 + flare_axis.left()) * light_size); Stats::quads++; @@ -1096,7 +1096,7 @@ void draw(float seconds) gl::disable(GL_DEPTH_TEST); // disable depth testing gl::depthmask(GL_FALSE); // disable depth buffer writing - glPolygonMode(GL_FRONT, GL_FILL); + gl::polygonmode(GL_FRONT, GL_FILL); draw_pass_sky(); // draw the skybox @@ -1124,20 +1124,20 @@ void draw(float seconds) // Interleaved format is GL_T2F_N3F_V3F // void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr ) - glTexCoordPointer(2, GL_FLOAT, 8 * sizeof(GLfloat), 0); + gl::texcoordpointer(2, GL_FLOAT, 8 * sizeof(GLfloat), 0); // void glNormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr) - glNormalPointer(GL_FLOAT, 8 * sizeof(GLfloat), (void*) (2 * sizeof(GLfloat))); + gl::normalpointer(GL_FLOAT, 8 * sizeof(GLfloat), (void*) (2 * sizeof(GLfloat))); // void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) - glVertexPointer(3, GL_FLOAT, 8 * sizeof(GLfloat), (void*) (5 * sizeof(GLfloat))); + gl::vertexpointer(3, GL_FLOAT, 8 * sizeof(GLfloat), (void*) (5 * sizeof(GLfloat))); } else { - glInterleavedArrays(GL_T2F_N3F_V3F, 0, core::game()->vertexarray()->ptr()); + gl::interleavedarrays(GL_T2F_N3F_V3F, 0, core::game()->vertexarray()->ptr()); } // enable vertex arrays - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_VERTEX_ARRAY); + gl::enableclientstate(GL_TEXTURE_COORD_ARRAY); + gl::enableclientstate(GL_NORMAL_ARRAY); + gl::enableclientstate(GL_VERTEX_ARRAY); State::set_normalize(true); @@ -1198,9 +1198,9 @@ void draw(float seconds) } } - glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); + gl::disableclientstate(GL_VERTEX_ARRAY); + gl::disableclientstate(GL_NORMAL_ARRAY); + gl::disableclientstate(GL_TEXTURE_COORD_ARRAY); // draw physics if (r_physics && r_physics->value()) { |