![]() |
naev 0.12.6
|
This file handles the opengl rendering routines. More...
#include "opengl_render.h"#include "camera.h"#include "gui.h"#include "opengl.h"
Go to the source code of this file.
Macros | |
| #define | OPENGL_RENDER_VBO_SIZE 256 |
Functions | |
| void | gl_beginSolidProgram (mat4 projection, const glColour *c) |
| void | gl_endSolidProgram (void) |
| void | gl_beginSmoothProgram (mat4 projection) |
| void | gl_endSmoothProgram () |
| void | gl_renderRect (double x, double y, double w, double h, const glColour *c) |
| Renders a rectangle. | |
| void | gl_renderRectEmpty (double x, double y, double w, double h, const glColour *c) |
| Renders a rectangle. | |
| void | gl_renderRectH (const mat4 *H, const glColour *c, int filled) |
| Renders a rectangle. | |
| void | gl_renderCross (double x, double y, double r, const glColour *c) |
| Renders a cross at a given position. | |
| void | gl_renderTriangleEmpty (double x, double y, double a, double s, double length, const glColour *c) |
| Renders a triangle at a given position. | |
| void | gl_renderDepthRawH (GLuint depth, const mat4 *projection, const mat4 *tex_mat) |
| void | gl_renderDepthRaw (GLuint depth, uint8_t flags, double x, double y, double w, double h, double tx, double ty, double tw, double th, double angle) |
| void | gl_renderTextureDepthRawH (GLuint texture, GLuint depth, const mat4 *projection, const mat4 *tex_mat, const glColour *c) |
| void | gl_renderTextureDepthRaw (GLuint texture, GLuint depth, uint8_t flags, double x, double y, double w, double h, double tx, double ty, double tw, double th, const glColour *c, double angle) |
| void | gl_renderTextureRawH (GLuint texture, const mat4 *projection, const mat4 *tex_mat, const glColour *c) |
| Texture blitting backend. | |
| void | gl_renderTextureRaw (GLuint texture, uint8_t flags, double x, double y, double w, double h, double tx, double ty, double tw, double th, const glColour *c, double angle) |
| Texture blitting backend. | |
| void | gl_renderTexture (const glTexture *texture, double x, double y, double w, double h, double tx, double ty, double tw, double th, const glColour *c, double angle) |
| Texture blitting backend. | |
| void | gl_renderSDF (const glTexture *texture, double x, double y, double w, double h, const glColour *c, double angle, double outline) |
| SDF Texture blitting backend. | |
| void | gl_renderTextureInterpolateRawH (GLuint ta, GLuint tb, double inter, const mat4 *projection, const mat4 *tex_mat, const glColour *c) |
| Texture blitting backend for interpolated texture. | |
| void | gl_renderTextureInterpolate (const glTexture *ta, const glTexture *tb, double inter, double x, double y, double w, double h, double tx, double ty, double tw, double th, const glColour *c) |
| Texture blitting backend for interpolated texture. | |
| void | gl_gameToScreenCoords (double *nx, double *ny, double bx, double by) |
| Converts in-game coordinates to screen coordinates. | |
| mat4 | gl_gameToScreenMatrix (mat4 lhs) |
| Return a transformation which converts in-game coordinates to screen coordinates. | |
| void | gl_screenToGameCoords (double *nx, double *ny, int bx, int by) |
| Converts screen coordinates to in-game coordinates. | |
| void | gl_renderSprite (const glTexture *sprite, double bx, double by, int sx, int sy, const glColour *c) |
| Blits a sprite, position is relative to the player. | |
| void | gl_renderSpriteScale (const glTexture *sprite, double bx, double by, double scalew, double scaleh, int sx, int sy, const glColour *c) |
| Blits a sprite, position is relative to the player. | |
| void | gl_renderSpriteRotate (const glTexture *sprite, double bx, double by, double angle, int sx, int sy, const glColour *c) |
| Blits a sprite, position is relative to the player with rotation. | |
| void | gl_renderSpriteScaleRotate (const glTexture *sprite, double bx, double by, double scalew, double scaleh, double angle, int sx, int sy, const glColour *c) |
| Blits a sprite, position is relative to the player with scaling and rotation. | |
| void | gl_renderSpriteInterpolate (const glTexture *sa, const glTexture *sb, double inter, double bx, double by, int sx, int sy, const glColour *c) |
| Blits a sprite interpolating, position is relative to the player. | |
| void | gl_renderSpriteInterpolateScale (const glTexture *sa, const glTexture *sb, double inter, double bx, double by, double scalew, double scaleh, int sx, int sy, const glColour *c) |
| Blits a sprite interpolating, position is relative to the player. | |
| void | gl_renderStaticSprite (const glTexture *sprite, double bx, double by, int sx, int sy, const glColour *c) |
| Blits a sprite, position is in absolute screen coordinates. | |
| void | gl_renderStaticSpriteInterpolate (const glTexture *sa, const glTexture *sb, double inter, double bx, double by, int sx, int sy, const glColour *c) |
| Blits a sprite interpolating, position is relative to the player. | |
| void | gl_renderStaticSpriteInterpolateScale (const glTexture *sa, const glTexture *sb, double inter, double bx, double by, double scalew, double scaleh, int sx, int sy, const glColour *c) |
| Blits a sprite interpolating, position is relative to the player. | |
| void | gl_renderScaleSprite (const glTexture *sprite, double bx, double by, int sx, int sy, double bw, double bh, const glColour *c) |
| Blits a scaled sprite, position is in absolute screen coordinates. | |
| void | gl_renderScale (const glTexture *texture, double bx, double by, double bw, double bh, const glColour *c) |
| Blits a texture scaling it. | |
| void | gl_renderScaleAspect (const glTexture *texture, double bx, double by, double bw, double bh, const glColour *c) |
| Blits a texture scaling it to fit a rectangle, but conserves aspect ratio. | |
| void | gl_renderStatic (const glTexture *texture, double bx, double by, const glColour *c) |
| Blits a texture to a position. | |
| void | gl_renderShader (double x, double y, double w, double h, double r, const SimpleShader *shd, const glColour *c, int center) |
| Renders a simple shader. | |
| void | gl_renderShaderH (const SimpleShader *shd, const mat4 *H, const glColour *c, int center) |
| Renders a simple shader with a transformation. | |
| void | gl_renderCircle (double cx, double cy, double r, const glColour *c, int filled) |
| Draws a circle. | |
| void | gl_renderCircleH (const mat4 *H, const glColour *c, int filled) |
| Draws a circle. | |
| void | gl_renderLine (double x1, double y1, double x2, double y2, const glColour *c) |
| Draws a line. | |
| void | gl_clipRect (int x, int y, int w, int h) |
| Sets up 2d clipping planes around a rectangle. | |
| void | gl_unclipRect (void) |
| Clears the 2d clipping planes. | |
| int | gl_initRender (void) |
| Initializes the OpenGL rendering routines. | |
| void | gl_exitRender (void) |
| Cleans up the OpenGL rendering routines. | |
Variables | |
| static gl_vbo * | gl_renderVBO = 0 |
| gl_vbo * | gl_squareVBO = 0 |
| static gl_vbo * | gl_squareEmptyVBO = 0 |
| gl_vbo * | gl_circleVBO = 0 |
| static gl_vbo * | gl_lineVBO = 0 |
| static gl_vbo * | gl_triangleVBO = 0 |
| static int | gl_renderVBOtexOffset = 0 |
| static int | gl_renderVBOcolOffset = 0 |
This file handles the opengl rendering routines.
There are two coordinate systems: relative and absolute.
Relative:
Absolute:
Note that the game actually uses a third type of coordinates for when using raw commands. In this third type, the (0.,0.) is actually in middle of the screen. (-SCREEN_W/2.,-SCREEN_H/2.) is bottom left and (+SCREEN_W/2.,+SCREEN_H/2.) is top right.
Definition in file opengl_render.c.
| #define OPENGL_RENDER_VBO_SIZE 256 |
Size of VBO.
Definition at line 36 of file opengl_render.c.
| void gl_beginSmoothProgram | ( | mat4 | projection | ) |
Definition at line 62 of file opengl_render.c.
| void gl_beginSolidProgram | ( | mat4 | projection, |
| const glColour * | c ) |
Definition at line 47 of file opengl_render.c.
| void gl_clipRect | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h ) |
Sets up 2d clipping planes around a rectangle.
| x | X position of the rectangle. |
| y | Y position of the rectangle. |
| w | Width of the rectangle. |
| h | Height of the rectangle. |
Definition at line 1233 of file opengl_render.c.
| void gl_endSmoothProgram | ( | void | ) |
Definition at line 70 of file opengl_render.c.
| void gl_endSolidProgram | ( | void | ) |
Definition at line 55 of file opengl_render.c.
| void gl_exitRender | ( | void | ) |
Cleans up the OpenGL rendering routines.
Definition at line 1325 of file opengl_render.c.
| void gl_gameToScreenCoords | ( | double * | nx, |
| double * | ny, | ||
| double | bx, | ||
| double | by ) |
Converts in-game coordinates to screen coordinates.
| [out] | nx | New screen X coord. |
| [out] | ny | New screen Y coord. |
| bx | Game X coord to translate. | |
| by | Game Y coord to translate. |
Definition at line 608 of file opengl_render.c.
Return a transformation which converts in-game coordinates to screen coordinates.
| lhs | Matrix to multiply by the conversion matrix. |
Definition at line 628 of file opengl_render.c.
| int gl_initRender | ( | void | ) |
Initializes the OpenGL rendering routines.
Definition at line 1258 of file opengl_render.c.
| void gl_renderCircle | ( | double | cx, |
| double | cy, | ||
| double | r, | ||
| const glColour * | c, | ||
| int | filled ) |
Draws a circle.
| cx | X position of the center in screen coordinates. |
| cy | Y position of the center in screen coordinates. |
| r | Radius of the circle. |
| c | Colour to use. |
| filled | Whether or not it should be filled. |
Definition at line 1175 of file opengl_render.c.
| void gl_renderCircleH | ( | const mat4 * | H, |
| const glColour * | c, | ||
| int | filled ) |
Draws a circle.
| H | Transformation matrix to draw the circle. |
| c | Colour to use. |
| filled | Whether or not it should be filled. |
Definition at line 1193 of file opengl_render.c.
| void gl_renderCross | ( | double | x, |
| double | y, | ||
| double | r, | ||
| const glColour * | c ) |
Renders a cross at a given position.
| x | X position to center at. |
| y | Y position to center at. |
| r | Radius of cross. |
| c | Colour to use. |
Definition at line 144 of file opengl_render.c.
| void gl_renderDepthRaw | ( | GLuint | depth, |
| uint8_t | flags, | ||
| double | x, | ||
| double | y, | ||
| double | w, | ||
| double | h, | ||
| double | tx, | ||
| double | ty, | ||
| double | tw, | ||
| double | th, | ||
| double | angle ) |
Definition at line 216 of file opengl_render.c.
Definition at line 178 of file opengl_render.c.
| void gl_renderLine | ( | double | x1, |
| double | y1, | ||
| double | x2, | ||
| double | y2, | ||
| const glColour * | c ) |
Draws a line.
| x1 | X position of the first point in screen coordinates. |
| y1 | Y position of the first point in screen coordinates. |
| x2 | X position of the second point in screen coordinates. |
| y2 | Y position of the second point in screen coordinates. |
| c | Colour to use. |
Definition at line 1213 of file opengl_render.c.
| void gl_renderRect | ( | double | x, |
| double | y, | ||
| double | w, | ||
| double | h, | ||
| const glColour * | c ) |
Renders a rectangle.
| x | X position to render rectangle at. |
| y | Y position to render rectangle at. |
| w | Rectangle width. |
| h | Rectangle height. |
| c | Rectangle colour. |
Definition at line 87 of file opengl_render.c.
| void gl_renderRectEmpty | ( | double | x, |
| double | y, | ||
| double | w, | ||
| double | h, | ||
| const glColour * | c ) |
Renders a rectangle.
| x | X position to render rectangle at. |
| y | Y position to render rectangle at. |
| w | Rectangle width. |
| h | Rectangle height. |
| c | Rectangle colour. |
Definition at line 105 of file opengl_render.c.
| void gl_renderRectH | ( | const mat4 * | H, |
| const glColour * | c, | ||
| int | filled ) |
Renders a rectangle.
| H | Transformation matrix to apply. |
| filled | Whether or not to fill. |
| c | Rectangle colour. |
Definition at line 121 of file opengl_render.c.
| void gl_renderScale | ( | const glTexture * | texture, |
| double | bx, | ||
| double | by, | ||
| double | bw, | ||
| double | bh, | ||
| const glColour * | c ) |
Blits a texture scaling it.
| texture | Texture to blit. |
| bx | X position of the texture in screen coordinates. |
| by | Y position of the texture in screen coordinates. |
| bw | Width to scale to. |
| bh | Height to scale to. |
| c | Colour to use (modifies texture colour). |
Definition at line 1046 of file opengl_render.c.
| void gl_renderScaleAspect | ( | const glTexture * | texture, |
| double | bx, | ||
| double | by, | ||
| double | bw, | ||
| double | bh, | ||
| const glColour * | c ) |
Blits a texture scaling it to fit a rectangle, but conserves aspect ratio.
| texture | Texture to blit. |
| bx | X position of the texture in screen coordinates. |
| by | Y position of the texture in screen coordinates. |
| bw | Width to scale to. |
| bh | Height to scale to. |
| c | Colour to use (modifies texture colour). |
Definition at line 1074 of file opengl_render.c.
| void gl_renderScaleSprite | ( | const glTexture * | sprite, |
| double | bx, | ||
| double | by, | ||
| int | sx, | ||
| int | sy, | ||
| double | bw, | ||
| double | bh, | ||
| const glColour * | c ) |
Blits a scaled sprite, position is in absolute screen coordinates.
| sprite | Sprite to blit. |
| bx | X position of the texture in screen coordinates. |
| by | Y position of the texture in screen coordinates. |
| sx | X position of the sprite to use. |
| sy | Y position of the sprite to use. |
| bw | Width of sprite to render at. |
| bh | Height of sprite to render at. |
| c | Colour to use (modifies texture colour). |
Definition at line 1018 of file opengl_render.c.
| void gl_renderSDF | ( | const glTexture * | texture, |
| double | x, | ||
| double | y, | ||
| double | w, | ||
| double | h, | ||
| const glColour * | c, | ||
| double | angle, | ||
| double | outline ) |
SDF Texture blitting backend.
| texture | Texture to blit. |
| x | X position of the texture on the screen. (units pixels) |
| y | Y position of the texture on the screen. (units pixels) |
| w | Width on the screen. (units pixels) |
| h | Height on the screen. (units pixels) |
| c | Colour to use (modifies texture colour). |
| angle | Rotation to apply (radians ccw around the center). |
| outline | Thickness of the outline. |
Definition at line 437 of file opengl_render.c.
| void gl_renderShader | ( | double | x, |
| double | y, | ||
| double | w, | ||
| double | h, | ||
| double | r, | ||
| const SimpleShader * | shd, | ||
| const glColour * | c, | ||
| int | center ) |
Renders a simple shader.
| x | X position. |
| y | Y position. |
| w | Width. |
| h | Height. |
| r | Rotation or 0. to disable. |
| shd | Shader to render. |
| c | Colour to use or NULL if not necessary. |
| center | Whether or not to center the shader on the position and use [-1,1] coordinates or set bottom-left and use [0,1] coordinates. |
Definition at line 1126 of file opengl_render.c.
| void gl_renderShaderH | ( | const SimpleShader * | shd, |
| const mat4 * | H, | ||
| const glColour * | c, | ||
| int | center ) |
Renders a simple shader with a transformation.
| shd | Shader to render. |
| H | Transformation matrix. |
| c | Colour to use or NULL if not necessary. |
| center | Whether or not to center the shader on the position and use [-1,1] coordinates or set bottom-left and use [0,1] coordinates. |
Definition at line 1147 of file opengl_render.c.
| void gl_renderSprite | ( | const glTexture * | sprite, |
| double | bx, | ||
| double | by, | ||
| int | sx, | ||
| int | sy, | ||
| const glColour * | c ) |
Blits a sprite, position is relative to the player.
Since position is in "game coordinates" it is subject to all sorts of position transformations.
| sprite | Sprite to blit. |
| bx | X position of the texture relative to the player. |
| by | Y position of the texture relative to the player. |
| sx | X position of the sprite to use. |
| sy | Y position of the sprite to use. |
| c | Colour to use (modifies texture colour). |
Definition at line 679 of file opengl_render.c.
| void gl_renderSpriteInterpolate | ( | const glTexture * | sa, |
| const glTexture * | sb, | ||
| double | inter, | ||
| double | bx, | ||
| double | by, | ||
| int | sx, | ||
| int | sy, | ||
| const glColour * | c ) |
Blits a sprite interpolating, position is relative to the player.
Since position is in "game coordinates" it is subject to all sorts of position transformations.
Interpolation is: sa*inter + sb*1.-inter)
| sa | Sprite A to blit. |
| sb | Sprite B to blit. |
| inter | Amount to interpolate. |
| bx | X position of the texture relative to the player. |
| by | Y position of the texture relative to the player. |
| sx | X position of the sprite to use. |
| sy | Y position of the sprite to use. |
| c | Colour to use (modifies texture colour). |
Definition at line 852 of file opengl_render.c.
| void gl_renderSpriteInterpolateScale | ( | const glTexture * | sa, |
| const glTexture * | sb, | ||
| double | inter, | ||
| double | bx, | ||
| double | by, | ||
| double | scalew, | ||
| double | scaleh, | ||
| int | sx, | ||
| int | sy, | ||
| const glColour * | c ) |
Blits a sprite interpolating, position is relative to the player.
Since position is in "game coordinates" it is subject to all sorts of position transformations.
Interpolation is: sa*inter + sb*1.-inter)
| sa | Sprite A to blit. |
| sb | Sprite B to blit. |
| inter | Amount to interpolate. |
| bx | X position of the texture relative to the player. |
| by | Y position of the texture relative to the player. |
| scalew | X scale factor. |
| scaleh | Y scale factor. |
| sx | X position of the sprite to use. |
| sy | Y position of the sprite to use. |
| c | Colour to use (modifies texture colour). |
Definition at line 878 of file opengl_render.c.
| void gl_renderSpriteRotate | ( | const glTexture * | sprite, |
| double | bx, | ||
| double | by, | ||
| double | angle, | ||
| int | sx, | ||
| int | sy, | ||
| const glColour * | c ) |
Blits a sprite, position is relative to the player with rotation.
Since position is in "game coordinates" it is subject to all sorts of position transformations.
| sprite | Sprite to blit. |
| bx | X position of the texture relative to the player. |
| by | Y position of the texture relative to the player. |
| angle | Angle to rotate when rendering. |
| sx | X position of the sprite to use. |
| sy | Y position of the sprite to use. |
| c | Colour to use (modifies texture colour). |
Definition at line 763 of file opengl_render.c.
| void gl_renderSpriteScale | ( | const glTexture * | sprite, |
| double | bx, | ||
| double | by, | ||
| double | scalew, | ||
| double | scaleh, | ||
| int | sx, | ||
| int | sy, | ||
| const glColour * | c ) |
Blits a sprite, position is relative to the player.
Since position is in "game coordinates" it is subject to all sorts of position transformations.
| sprite | Sprite to blit. |
| bx | X position of the texture relative to the player. |
| by | Y position of the texture relative to the player. |
| scalew | Scaling of width. |
| scaleh | Scaling of height. |
| sx | X position of the sprite to use. |
| sy | Y position of the sprite to use. |
| c | Colour to use (modifies texture colour). |
Definition at line 721 of file opengl_render.c.
| void gl_renderSpriteScaleRotate | ( | const glTexture * | sprite, |
| double | bx, | ||
| double | by, | ||
| double | scalew, | ||
| double | scaleh, | ||
| double | angle, | ||
| int | sx, | ||
| int | sy, | ||
| const glColour * | c ) |
Blits a sprite, position is relative to the player with scaling and rotation.
Since position is in "game coordinates" it is subject to all sorts of position transformations.
| sprite | Sprite to blit. |
| bx | X position of the texture relative to the player. |
| by | Y position of the texture relative to the player. |
| scalew | Scaling of width. |
| scaleh | Scaling of height. |
| angle | Angle to rotate when rendering. |
| sx | X position of the sprite to use. |
| sy | Y position of the sprite to use. |
| c | Colour to use (modifies texture colour). |
Definition at line 807 of file opengl_render.c.
| void gl_renderStatic | ( | const glTexture * | texture, |
| double | bx, | ||
| double | by, | ||
| const glColour * | c ) |
Blits a texture to a position.
| texture | Texture to blit. |
| bx | X position of the texture in screen coordinates. |
| by | Y position of the texture in screen coordinates. |
| c | Colour to use (modifies texture colour). |
Definition at line 1099 of file opengl_render.c.
| void gl_renderStaticSprite | ( | const glTexture * | sprite, |
| double | bx, | ||
| double | by, | ||
| int | sx, | ||
| int | sy, | ||
| const glColour * | c ) |
Blits a sprite, position is in absolute screen coordinates.
| sprite | Sprite to blit. |
| bx | X position of the texture in screen coordinates. |
| by | Y position of the texture in screen coordinates. |
| sx | X position of the sprite to use. |
| sy | Y position of the sprite to use. |
| c | Colour to use (modifies texture colour). |
Definition at line 917 of file opengl_render.c.
| void gl_renderStaticSpriteInterpolate | ( | const glTexture * | sa, |
| const glTexture * | sb, | ||
| double | inter, | ||
| double | bx, | ||
| double | by, | ||
| int | sx, | ||
| int | sy, | ||
| const glColour * | c ) |
Blits a sprite interpolating, position is relative to the player.
Since position is in "game coordinates" it is subject to all sorts of position transformations.
Interpolation is: sa*inter + sb*1.-inter)
| sa | Sprite A to blit. |
| sb | Sprite B to blit. |
| inter | Amount to interpolate. |
| bx | X position of the texture in screen coordinates. |
| by | Y position of the texture in screen coordinates. |
| sx | X position of the sprite to use. |
| sy | Y position of the sprite to use. |
| c | Colour to use (modifies texture colour). |
Definition at line 951 of file opengl_render.c.
| void gl_renderStaticSpriteInterpolateScale | ( | const glTexture * | sa, |
| const glTexture * | sb, | ||
| double | inter, | ||
| double | bx, | ||
| double | by, | ||
| double | scalew, | ||
| double | scaleh, | ||
| int | sx, | ||
| int | sy, | ||
| const glColour * | c ) |
Blits a sprite interpolating, position is relative to the player.
Since position is in "game coordinates" it is subject to all sorts of position transformations.
Interpolation is: sa*inter + sb*1.-inter)
| sa | Sprite A to blit. |
| sb | Sprite B to blit. |
| inter | Amount to interpolate. |
| bx | X position of the texture in screen coordinates. |
| by | Y position of the texture in screen coordinates. |
| scalew | X scale factor. |
| scaleh | Y scale factor. |
| sx | X position of the sprite to use. |
| sy | Y position of the sprite to use. |
| c | Colour to use (modifies texture colour). |
Definition at line 978 of file opengl_render.c.
| void gl_renderTexture | ( | const glTexture * | texture, |
| double | x, | ||
| double | y, | ||
| double | w, | ||
| double | h, | ||
| double | tx, | ||
| double | ty, | ||
| double | tw, | ||
| double | th, | ||
| const glColour * | c, | ||
| double | angle ) |
Texture blitting backend.
| texture | Texture to blit. |
| x | X position of the texture on the screen. (units pixels) |
| y | Y position of the texture on the screen. (units pixels) |
| w | Width on the screen. (units pixels) |
| h | Height on the screen. (units pixels) |
| tx | X position within the texture. [0:1] |
| ty | Y position within the texture. [0:1] |
| tw | Texture width. [0:1] |
| th | Texture height. [0:1] |
| c | Colour to use (modifies texture colour). |
| angle | Rotation to apply (radians ccw around the center). |
Definition at line 417 of file opengl_render.c.
| void gl_renderTextureDepthRaw | ( | GLuint | texture, |
| GLuint | depth, | ||
| uint8_t | flags, | ||
| double | x, | ||
| double | y, | ||
| double | w, | ||
| double | h, | ||
| double | tx, | ||
| double | ty, | ||
| double | tw, | ||
| double | th, | ||
| const glColour * | c, | ||
| double | angle ) |
Definition at line 288 of file opengl_render.c.
| void gl_renderTextureDepthRawH | ( | GLuint | texture, |
| GLuint | depth, | ||
| const mat4 * | projection, | ||
| const mat4 * | tex_mat, | ||
| const glColour * | c ) |
Definition at line 243 of file opengl_render.c.
| void gl_renderTextureInterpolate | ( | const glTexture * | ta, |
| const glTexture * | tb, | ||
| double | inter, | ||
| double | x, | ||
| double | y, | ||
| double | w, | ||
| double | h, | ||
| double | tx, | ||
| double | ty, | ||
| double | tw, | ||
| double | th, | ||
| const glColour * | c ) |
Texture blitting backend for interpolated texture.
Value blitted is ta*inter + tb*(1.-inter).
| ta | Texture A to blit. |
| tb | Texture B to blit. |
| inter | Amount of interpolation to do. |
| x | X position of the texture on the screen. |
| y | Y position of the texture on the screen. |
| w | Width on the screen. (units pixels) |
| h | Height on the screen. (units pixels) |
| tx | X position within the texture. |
| ty | Y position within the texture. |
| tw | Texture width. |
| th | Texture height. |
| c | Colour to use (modifies texture colour). |
Definition at line 576 of file opengl_render.c.
| void gl_renderTextureInterpolateRawH | ( | GLuint | ta, |
| GLuint | tb, | ||
| double | inter, | ||
| const mat4 * | projection, | ||
| const mat4 * | tex_mat, | ||
| const glColour * | c ) |
Texture blitting backend for interpolated texture.
| ta | Texture id A to blit. |
| tb | Texture id B to blit. |
| inter | Amount of interpolation to do. |
| projection | Projection matrix tu use. |
| tex_mat | Texture matrix to use. |
| c | Colour to use (modifies texture colour). |
Definition at line 510 of file opengl_render.c.
| void gl_renderTextureRaw | ( | GLuint | texture, |
| uint8_t | flags, | ||
| double | x, | ||
| double | y, | ||
| double | w, | ||
| double | h, | ||
| double | tx, | ||
| double | ty, | ||
| double | tw, | ||
| double | th, | ||
| const glColour * | c, | ||
| double | angle ) |
Texture blitting backend.
| texture | Texture to blit. |
| flags | Texture flags,. |
| x | X position of the texture on the screen. (units pixels) |
| y | Y position of the texture on the screen. (units pixels) |
| w | Width on the screen. (units pixels) |
| h | Height on the screen. (units pixels) |
| tx | X position within the texture. [0:1] |
| ty | Y position within the texture. [0:1] |
| tw | Texture width. [0:1] |
| th | Texture height. [0:1] |
| c | Colour to use (modifies texture colour). |
| angle | Rotation to apply (radians ccw around the center). |
Definition at line 374 of file opengl_render.c.
| void gl_renderTextureRawH | ( | GLuint | texture, |
| const mat4 * | projection, | ||
| const mat4 * | tex_mat, | ||
| const glColour * | c ) |
Texture blitting backend.
| texture | Texture to blit. |
| projection | Projection matrix tu use. |
| tex_mat | Texture matrix to use. |
| c | Colour to use (modifies texture colour). |
Definition at line 324 of file opengl_render.c.
| void gl_renderTriangleEmpty | ( | double | x, |
| double | y, | ||
| double | a, | ||
| double | s, | ||
| double | length, | ||
| const glColour * | c ) |
Renders a triangle at a given position.
| x | X position to center at. |
| y | Y position to center at. |
| a | Angle the triangle should "face" (right is 0.) |
| s | Scaling of the triangle. |
| length | Length deforming factor. Setting it to a value of other than 1. moves away from an equilateral triangle. |
| c | Colour to use. |
Definition at line 162 of file opengl_render.c.
| void gl_screenToGameCoords | ( | double * | nx, |
| double * | ny, | ||
| int | bx, | ||
| int | by ) |
Converts screen coordinates to in-game coordinates.
| [out] | nx | New in-game X coord. |
| [out] | ny | New in-game Y coord. |
| bx | Screen X coord to translate. | |
| by | Screen Y coord to translate. |
Definition at line 652 of file opengl_render.c.
| void gl_unclipRect | ( | void | ) |
Clears the 2d clipping planes.
Definition at line 1247 of file opengl_render.c.
| gl_vbo* gl_circleVBO = 0 |
Definition at line 41 of file opengl_render.c.
|
static |
Definition at line 42 of file opengl_render.c.
|
static |
VBO for rendering stuff.
Definition at line 38 of file opengl_render.c.
|
static |
VBO colour offset.
Definition at line 45 of file opengl_render.c.
|
static |
VBO texture offset.
Definition at line 44 of file opengl_render.c.
|
static |
Definition at line 40 of file opengl_render.c.
| gl_vbo* gl_squareVBO = 0 |
Definition at line 39 of file opengl_render.c.
|
static |
Definition at line 43 of file opengl_render.c.