From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/render/gl.h | 312 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 156 insertions(+), 156 deletions(-) (limited to 'src/render/gl.h') diff --git a/src/render/gl.h b/src/render/gl.h index e182117..81c19b0 100644 --- a/src/render/gl.h +++ b/src/render/gl.h @@ -1,7 +1,7 @@ /* render/gl.h - This file is part of the Osirion project and is distributed under - the terms of the GNU General Public License version 2 + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 */ #ifndef __INCLUDED_RENDER_GL_H__ @@ -45,160 +45,160 @@ */ namespace gl { - /// name of the hardware OpenGL renderer - std::string renderer(); - /// vender of the system OpenGL implementation - std::string vendor(); - /// version of the system OpenGL implementation - std::string version(); - /// Opengl Extensions string - std::string extensions(); - - /// enum to denote Vertex drawing modes - enum Primitive { - Points=GL_POINTS, - Lines=GL_LINES, - LineStrip=GL_LINE_STRIP, - LineLoop=GL_LINE_LOOP, - Triangles=GL_TRIANGLES, - TriangleStrip=GL_TRIANGLE_STRIP, - TriangleFan=GL_TRIANGLE_FAN, - Quads=GL_QUADS, - QuadStrip=GL_QUAD_STRIP, - Polygon=GL_POLYGON - }; - - /// glViewPort - void viewport(GLint x, GLint y, GLsizei width, GLsizei height ); - - /// set the color used to clear to buffer - void clearcolor(math::Color const &color); - void clearcolor(const float r, const float g, const float b, const float a); - - /// clear buffers to preset values - void clear (GLbitfield mask); - - /// glMatrixMode - void matrixmode(GLenum mode); - - /// glEnable - void enable(GLenum cap); - - /// glDisable - void disable(GLenum cap); - - /// glShadeModel - void shademodel(GLenum mode); - - /// glCullFace - void cullface(GLenum mode); - - /// glFrontFace - void frontface(GLenum mode); - - /// glDepthMask - void depthmask(GLenum mode); - - /// glBlendFunc - void blendfunc(GLenum sfactor, GLenum dfactor); - - /// Delimite the start of a sequence of verteces describing a primitive or group of primitives - /** @param primitive The type of drawing primitive - * @see end() - */ - void begin(Primitive primitive); - - /// delimit the end of a sequence of verteces describing a primitive or group of primitives - /** @see begin() - */ - void end(); - - /// Add the next vertex the the current drawing operation - /** From the glVertex() description: - * vertex() commands are used within begin()/end() pairs to specify point, - * line, and polygon vertices. The current color, normal, and texture - * coordinates are associated with the vertex when vertex() is called. - */ - void vertex(const math::Vector3f& vector); - - void vertex(const float x, const float y, const float z); - - void vertex(const math::Vector2f& vector); - - void vertex(const float x, const float y); - - /// glNormal - void normal(const math::Vector3f & vector); - - void normal(const float x, const float y, const float z); - - /// multiply the current matrix by a general rotation matrix - /** @param angle The angle of the rotation, in degrees [0-360] - * @param vector The rotation axes, relative to the origin (0,0,0) - */ - void rotate(const float angle, const math::Vector3f& vector); - - /// multiply the current matrix by a general rotation matrix - /** @param angle The angle of the rotation, in degrees - * @param x The x-coordinate of the rotation vector - * @param y The y-coordinate of the rotation vector - * @param z The z-coordinate of the rotation vector - */ - void rotate(const float angle, const float x, const float y, const float z); - - /// multiply the current matrix by a general translation matrix - /** @param vector The translation vector, relative to the origin (0,0,0) - */ - void translate(const math::Vector3f& vector); - - /// multiply the current matrix by a general translation matrix - /** @param x The x-coordinate of the translation vector - * @param y The y-coordinate of the translation vector - * @param z The z-coordinate of the translation vector - */ - void translate(const float x, const float y, const float z); - - /// multiply the current matrix by a general scaling matrix - /** @param vector The scale factor for all 3 axes - */ - void scale(const math::Vector3f& vector); - - /// multiply the current matrix by a general scaling matrix - /** @param x x-scaling factor - * @param y y-scaling factor - * @param z z-scaling factor - */ - void scale(const float x, const float y, const float z); - - /// multiply the current matrix with a coordinate system transformation - void multmatrix(const math::Axis & axis); - - /// multiply the current matrix with a 4x4 float matrix - void multmatrix(const math::Matrix4f & matrix); - - /// specify the drawing color for the next GL functions - /** @param color the new drawing color - */ - void color(math::Color const & color); - - /** @param r red value of the new drawing color - * @param g green value of the new drawing color - * @param b blue value of the new drawing color - * @param a alpha value of the new drawing color - */ - void color(const float r, const float g, const float b, const float a=1.0f); - - /// Push the current transformation matrix to the stack - void push(); - - /// Replace the transformation matrix with the top from the stack - void pop(); - - /// Replace the transformation matrix with the identity matrtix - void loadidentity(); - - /// Perspective matrix - void frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble znear, GLdouble zfar); +/// name of the hardware OpenGL renderer +std::string renderer(); +/// vender of the system OpenGL implementation +std::string vendor(); +/// version of the system OpenGL implementation +std::string version(); +/// Opengl Extensions string +std::string extensions(); + +/// enum to denote Vertex drawing modes +enum Primitive { + Points = GL_POINTS, + Lines = GL_LINES, + LineStrip = GL_LINE_STRIP, + LineLoop = GL_LINE_LOOP, + Triangles = GL_TRIANGLES, + TriangleStrip = GL_TRIANGLE_STRIP, + TriangleFan = GL_TRIANGLE_FAN, + Quads = GL_QUADS, + QuadStrip = GL_QUAD_STRIP, + Polygon = GL_POLYGON +}; + +/// glViewPort +void viewport(GLint x, GLint y, GLsizei width, GLsizei height); + +/// set the color used to clear to buffer +void clearcolor(math::Color const &color); +void clearcolor(const float r, const float g, const float b, const float a); + +/// clear buffers to preset values +void clear(GLbitfield mask); + +/// glMatrixMode +void matrixmode(GLenum mode); + +/// glEnable +void enable(GLenum cap); + +/// glDisable +void disable(GLenum cap); + +/// glShadeModel +void shademodel(GLenum mode); + +/// glCullFace +void cullface(GLenum mode); + +/// glFrontFace +void frontface(GLenum mode); + +/// glDepthMask +void depthmask(GLenum mode); + +/// glBlendFunc +void blendfunc(GLenum sfactor, GLenum dfactor); + +/// Delimite the start of a sequence of verteces describing a primitive or group of primitives +/** @param primitive The type of drawing primitive + * @see end() + */ +void begin(Primitive primitive); + +/// delimit the end of a sequence of verteces describing a primitive or group of primitives +/** @see begin() + */ +void end(); + +/// Add the next vertex the the current drawing operation +/** From the glVertex() description: + * vertex() commands are used within begin()/end() pairs to specify point, + * line, and polygon vertices. The current color, normal, and texture + * coordinates are associated with the vertex when vertex() is called. + */ +void vertex(const math::Vector3f& vector); + +void vertex(const float x, const float y, const float z); + +void vertex(const math::Vector2f& vector); + +void vertex(const float x, const float y); + +/// glNormal +void normal(const math::Vector3f & vector); + +void normal(const float x, const float y, const float z); + +/// multiply the current matrix by a general rotation matrix +/** @param angle The angle of the rotation, in degrees [0-360] + * @param vector The rotation axes, relative to the origin (0,0,0) + */ +void rotate(const float angle, const math::Vector3f& vector); + +/// multiply the current matrix by a general rotation matrix +/** @param angle The angle of the rotation, in degrees + * @param x The x-coordinate of the rotation vector + * @param y The y-coordinate of the rotation vector + * @param z The z-coordinate of the rotation vector + */ +void rotate(const float angle, const float x, const float y, const float z); + +/// multiply the current matrix by a general translation matrix +/** @param vector The translation vector, relative to the origin (0,0,0) + */ +void translate(const math::Vector3f& vector); + +/// multiply the current matrix by a general translation matrix +/** @param x The x-coordinate of the translation vector + * @param y The y-coordinate of the translation vector + * @param z The z-coordinate of the translation vector + */ +void translate(const float x, const float y, const float z); + +/// multiply the current matrix by a general scaling matrix +/** @param vector The scale factor for all 3 axes + */ +void scale(const math::Vector3f& vector); + +/// multiply the current matrix by a general scaling matrix +/** @param x x-scaling factor + * @param y y-scaling factor + * @param z z-scaling factor + */ +void scale(const float x, const float y, const float z); + +/// multiply the current matrix with a coordinate system transformation +void multmatrix(const math::Axis & axis); + +/// multiply the current matrix with a 4x4 float matrix +void multmatrix(const math::Matrix4f & matrix); + +/// specify the drawing color for the next GL functions +/** @param color the new drawing color + */ +void color(math::Color const & color); + +/** @param r red value of the new drawing color + * @param g green value of the new drawing color + * @param b blue value of the new drawing color + * @param a alpha value of the new drawing color + */ +void color(const float r, const float g, const float b, const float a = 1.0f); + +/// Push the current transformation matrix to the stack +void push(); + +/// Replace the transformation matrix with the top from the stack +void pop(); + +/// Replace the transformation matrix with the identity matrtix +void loadidentity(); + +/// Perspective matrix +void frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble znear, GLdouble zfar); } #endif // __INCLUDED_RENDER_GL_H__ -- cgit v1.2.3