|
blaze
|
#include "stddef.h"#include "./cassert.h"#include "./deps/SOIL/SOIL.h"#include "./glad/include/glad/glad.h"Go to the source code of this file.
Data Structures | |
| struct | BLZ_BlendFunc |
| Defines a blending function. More... | |
| struct | BLZ_Rectangle |
| A rectangle which has it's top-left corner position, width and height expressed in floats. More... | |
| struct | BLZ_RenderTarget |
| Render target object. More... | |
| struct | BLZ_SpriteQuad |
| Underlying sprite quad data structure. More... | |
| struct | BLZ_Texture |
| Defines a texture. More... | |
| struct | BLZ_Vector2 |
| A vector which contains 2 floats. More... | |
| struct | BLZ_Vector4 |
| A vector which contains 4 floats. More... | |
| struct | BLZ_Vertex |
| Underlying vertex array structure. More... | |
Typedefs | |
| typedef struct BLZ_Shader | BLZ_Shader |
| Represents a GLSL shader handle. More... | |
| typedef struct BLZ_SpriteBatch | BLZ_SpriteBatch |
| Defines a dynamic sprite batch which is drawn when BLZ_Present is called. More... | |
| typedef struct BLZ_StaticBatch | BLZ_StaticBatch |
| Defines a pre-baked sprite batch which is useful for drawing static geometry like tiles. More... | |
| typedef void(* | glGetProcAddress )(const char *name) |
| OpenGL function loader signature. More... | |
Functions | |
| BLZAPIENTRY int BLZAPICALL | BLZ_BindRenderTarget (struct BLZ_RenderTarget *target) |
| Binds the specified render target for output. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_BindTexture (struct BLZ_Texture *texture, int slot) |
| Binds the specified texture to the specified slot number. More... | |
| BLZAPIENTRY void BLZAPICALL | BLZ_Clear () |
| Clears the screen with the specified color. More... | |
| BLZAPIENTRY struct BLZ_Shader *BLZAPICALL | BLZ_CompileShader (char *vert, char *frag) |
| Compiles a shader program from the specified sources. More... | |
| BLZAPIENTRY struct BLZ_SpriteBatch *BLZAPICALL | BLZ_CreateBatch (int max_buckets, int max_sprites_per_bucket, enum BLZ_InitFlags flags) |
| Creates a new dynamic batch using the specified parameters. More... | |
| BLZAPIENTRY struct BLZ_RenderTarget *BLZAPICALL | BLZ_CreateRenderTarget (int width, int height) |
| Creates a RGBA render target using specified parameters. More... | |
| BLZAPIENTRY struct BLZ_StaticBatch BLZAPICALL * | BLZ_CreateStatic (struct BLZ_Texture *texture, int max_sprite_count) |
| Creates a 'static' batch object. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_Draw (struct BLZ_SpriteBatch *batch, struct BLZ_Texture *texture, struct BLZ_Vector2 position, struct BLZ_Rectangle *srcRectangle, float rotation, struct BLZ_Vector2 *origin, struct BLZ_Vector2 *scale, struct BLZ_Vector4 color, enum BLZ_SpriteFlip effects) |
| Adds a sprite to specified batch using specified parameters. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_DrawImmediate (struct BLZ_Texture *texture, struct BLZ_Vector2 position, struct BLZ_Rectangle *srcRectangle, float rotation, struct BLZ_Vector2 *origin, struct BLZ_Vector2 *scale, struct BLZ_Vector4 color, enum BLZ_SpriteFlip effects) |
| Immediately draws a sprite using the specified parameters to screen. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_DrawStatic (struct BLZ_StaticBatch *batch, struct BLZ_Vector2 position, struct BLZ_Rectangle *srcRectangle, float rotation, struct BLZ_Vector2 *origin, struct BLZ_Vector2 *scale, struct BLZ_Vector4 color, enum BLZ_SpriteFlip effects) |
| Adds a sprite to specified batch using specified parameters. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_FreeBatch (struct BLZ_SpriteBatch *batch) |
| Destroys the specified dynamic batch object. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_FreeBatchStatic (struct BLZ_StaticBatch *batch) |
| Destroys the specified static batch object. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_FreeRenderTarget (struct BLZ_RenderTarget *target) |
| Destroys the specified render target. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_FreeShader (BLZ_Shader *program) |
| Frees memory used by specified shader program. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_FreeTexture (struct BLZ_Texture *texture) |
| Frees the specified texture. More... | |
| BLZAPIENTRY struct BLZ_Shader BLZAPICALL * | BLZ_GetDefaultShader () |
| Returns a pointer to the default shader program. More... | |
| BLZAPIENTRY char *BLZAPICALL | BLZ_GetLastError () |
| Returns a pointer to error string, if any. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_GetMaxTextureSlots () |
| Returns the maximum count of available texture slots which can be used simultaneously for BLZ_BindTexture texture binding. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_GetOptions (struct BLZ_SpriteBatch *batch, int *max_buckets, int *max_sprites_per_bucket, enum BLZ_InitFlags *flags) |
| Reads options specified in BLZ_CreateBatch for the specified batch object. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_GetOptionsStatic (struct BLZ_StaticBatch *batch, int *max_sprite_count) |
| Reads options specified in BLZ_CreateStatic for the specified static batch object. More... | |
| BLZAPIENTRY GLint BLZAPICALL | BLZ_GetUniformLocation (struct BLZ_Shader *shader, const char *name) |
| Returns the uniform location for the specified shader program. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_Load (glGetProcAddress loader) |
| Loads the OpenGL functions using the specified loader and initializes the library. More... | |
| BLZAPIENTRY struct BLZ_Texture *BLZAPICALL | BLZ_LoadTextureFromFile (const char *filename, enum BLZ_ImageChannels channels, unsigned int texture_id, enum BLZ_ImageFlags flags) |
| Loads a texture from file. More... | |
| BLZAPIENTRY struct BLZ_Texture *BLZAPICALL | BLZ_LoadTextureFromMemory (const unsigned char *const buffer, int buffer_length, enum BLZ_ImageChannels force_channels, unsigned int texture_id, enum BLZ_ImageFlags flags) |
| Loads a texture from memory. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_LowerDraw (struct BLZ_SpriteBatch *batch, GLuint texture, struct BLZ_SpriteQuad *quad) |
| Lower level dynamic batching function, called by BLZ_Draw. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_LowerDrawImmediate (GLuint texture, struct BLZ_SpriteQuad *quad) |
| Lower level immediate drawing function, called by BLZ_DrawImmediate. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_LowerDrawStatic (struct BLZ_StaticBatch *batch, struct BLZ_SpriteQuad *quad) |
| Lower level static batching function, called by BLZ_DrawStatic. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_Present (struct BLZ_SpriteBatch *batch) |
| Draws everything from the specified dynamic batch to screen. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_PresentStatic (struct BLZ_StaticBatch *batch, GLfloat *transformMatrix4x4) |
| Draws everything from the specified static batch to screen. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_SaveScreenshot (const char *filename, enum BLZ_SaveImageFormat format, int x, int y, int width, int height) |
| Saves a screenshot to file. More... | |
| BLZAPIENTRY void BLZAPICALL | BLZ_SetBlendMode (const struct BLZ_BlendFunc func) |
| Sets the currently used blend function. More... | |
| BLZAPIENTRY void BLZAPICALL | BLZ_SetClearColor (struct BLZ_Vector4 color) |
| Sets the background clear color. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_SetTextureFiltering (struct BLZ_Texture *texture, enum BLZ_TextureFilter minification, enum BLZ_TextureFilter magnification) |
| Sets the texture filtering mode. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_SetTextureWrap (struct BLZ_Texture *texture, enum BLZ_TextureWrap x, enum BLZ_TextureWrap y) |
| Sets the texture wrapping mode. More... | |
| BLZAPIENTRY int BLZAPICALL | BLZ_SetViewport (int w, int h) |
| Sets the viewport size in pixels. More... | |
| BLZAPIENTRY void BLZAPICALL | BLZ_Uniform1f (GLint location, GLfloat v0) |
| BLZAPIENTRY void BLZAPICALL | BLZ_Uniform1i (GLint location, GLint v0) |
| BLZAPIENTRY void BLZAPICALL | BLZ_Uniform1ui (GLint location, GLuint v0) |
| BLZAPIENTRY void BLZAPICALL | BLZ_Uniform2f (GLint location, GLfloat v0, GLfloat v1) |
| BLZAPIENTRY void BLZAPICALL | BLZ_Uniform2i (GLint location, GLint v0, GLint v1) |
| BLZAPIENTRY void BLZAPICALL | BLZ_Uniform2ui (GLint location, GLuint v0, GLuint v1) |
| BLZAPIENTRY void BLZAPICALL | BLZ_Uniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2) |
| BLZAPIENTRY void BLZAPICALL | BLZ_Uniform3i (GLint location, GLint v0, GLint v1, GLint v2) |
| BLZAPIENTRY void BLZAPICALL | BLZ_Uniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2) |
| BLZAPIENTRY void BLZAPICALL | BLZ_Uniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) |
| BLZAPIENTRY void BLZAPICALL | BLZ_Uniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3) |
| BLZAPIENTRY void BLZAPICALL | BLZ_Uniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) |
| BLZAPIENTRY void BLZAPICALL | BLZ_UniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
| BLZAPIENTRY void BLZAPICALL | BLZ_UniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
| BLZAPIENTRY void BLZAPICALL | BLZ_UniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
| BLZAPIENTRY void BLZAPICALL | BLZ_UniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
| BLZAPIENTRY void BLZAPICALL | BLZ_UniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
| BLZAPIENTRY void BLZAPICALL | BLZ_UniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
| BLZAPIENTRY void BLZAPICALL | BLZ_UniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
| BLZAPIENTRY void BLZAPICALL | BLZ_UniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
| BLZAPIENTRY void BLZAPICALL | BLZ_UniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) |
| BLZAPIENTRY int BLZAPICALL | BLZ_UseShader (BLZ_Shader *program) |
| Sets the specified shader as the current. More... | |
Variables | |
| const struct BLZ_BlendFunc | BLEND_ADDITIVE |
| Additive blending (src = ONE, dst = ONE) More... | |
| const struct BLZ_BlendFunc | BLEND_MULTIPLY |
| Multiplicative blending (src = DST_COLOR, dst = ZERO) More... | |
| const struct BLZ_BlendFunc | BLEND_NORMAL |
| Normal alpha blending (src = SRC_ALPHA, dst = ONE_MINUS_SRC_ALPHA) More... | |
| typedef struct BLZ_Shader BLZ_Shader |
Represents a GLSL shader handle.
| typedef struct BLZ_SpriteBatch BLZ_SpriteBatch |
Defines a dynamic sprite batch which is drawn when BLZ_Present is called.
| typedef struct BLZ_StaticBatch BLZ_StaticBatch |
Defines a pre-baked sprite batch which is useful for drawing static geometry like tiles.
| typedef void(* glGetProcAddress)(const char *name) |
OpenGL function loader signature.
| enum BLZ_BlendFactor |
Defines a blend factor in blending equation.
| Enumerator | |
|---|---|
| ZERO | |
| ONE | |
| SRC_COLOR | |
| ONE_MINUS_SRC_COLOR | |
| DST_COLOR | |
| ONE_MINUS_DST_COLOR | |
| SRC_ALPHA | |
| ONE_MINUS_SRC_ALPHA | |
| DST_ALPHA | |
| ONE_MINUS_DST_ALPHA | |
| enum BLZ_SpriteFlip |
| const struct BLZ_BlendFunc BLEND_ADDITIVE |
Additive blending (src = ONE, dst = ONE)
| const struct BLZ_BlendFunc BLEND_MULTIPLY |
Multiplicative blending (src = DST_COLOR, dst = ZERO)
| const struct BLZ_BlendFunc BLEND_NORMAL |
Normal alpha blending (src = SRC_ALPHA, dst = ONE_MINUS_SRC_ALPHA)