|
SDL_gpu
0.11.0
A hardware-accelerated, cross-platform 2D graphics API
|
#include <stdlib.h>#include "SDL_platform.h"#include <math.h>#include <string.h>#include "stb_image.h"#include "stb_image_write.h"Go to the source code of this file.
Macros | |
| #define | intptr_t long |
| #define | M_PI 3.14159265358979323846 |
| #define | static_inline static inline |
| #define | GPU_BLIT_BUFFER_VERTICES_PER_SPRITE 4 |
| #define | GPU_BLIT_BUFFER_INIT_MAX_NUM_VERTICES (GPU_BLIT_BUFFER_VERTICES_PER_SPRITE*1000) |
| #define | GPU_BLIT_BUFFER_ABSOLUTE_MAX_VERTICES 60000 |
| #define | GPU_INDEX_BUFFER_ABSOLUTE_MAX_VERTICES 4000000000u |
| #define | GPU_BLIT_BUFFER_FLOATS_PER_VERTEX 8 |
| #define | GPU_BLIT_BUFFER_STRIDE (sizeof(float)*GPU_BLIT_BUFFER_FLOATS_PER_VERTEX) |
| #define | GPU_BLIT_BUFFER_VERTEX_OFFSET 0 |
| #define | GPU_BLIT_BUFFER_TEX_COORD_OFFSET 2 |
| #define | GPU_BLIT_BUFFER_COLOR_OFFSET 4 |
| #define | SDL_Window SDL_Surface |
| #define | GET_ALPHA(sdl_color) ((sdl_color).unused) |
| #define | SDL_GPU_DISABLE_SHADERS |
| #define | MIX_COLOR_COMPONENT_NORMALIZED_RESULT(a, b) ((a)/255.0f * (b)/255.0f) |
| #define | MIX_COLOR_COMPONENT(a, b) (((a)/255.0f * (b)/255.0f)*255) |
| #define | SET_TEXTURED_VERTEX(x, y, s, t, r, g, b, a) |
| #define | SET_TEXTURED_VERTEX_UNINDEXED(x, y, s, t, r, g, b, a) |
| #define | SET_UNTEXTURED_VERTEX(x, y, r, g, b, a) |
| #define | SET_UNTEXTURED_VERTEX_UNINDEXED(x, y, r, g, b, a) |
| #define | SET_INDEXED_VERTEX(offset) index_buffer[cdata->index_buffer_num_vertices++] = blit_buffer_starting_index + (offset); |
| #define | SET_RELATIVE_INDEXED_VERTEX(offset) index_buffer[cdata->index_buffer_num_vertices++] = cdata->blit_buffer_num_vertices + (offset); |
| #define | BEGIN_UNTEXTURED_SEGMENTS(x1, y1, x2, y2, r, g, b, a) |
| #define | SET_UNTEXTURED_SEGMENTS(x1, y1, x2, y2, r, g, b, a) |
| #define | LOOP_UNTEXTURED_SEGMENTS() |
| #define | END_UNTEXTURED_SEGMENTS(x1, y1, x2, y2, r, g, b, a) |
| #define | MAX(a, b) ((a) > (b)? (a) : (b)) |
| #define | SET_COMMON_FUNCTIONS(impl) |
| #define BEGIN_UNTEXTURED_SEGMENTS | ( | x1, | |
| y1, | |||
| x2, | |||
| y2, | |||
| r, | |||
| g, | |||
| b, | |||
| a | |||
| ) |
Definition at line 3860 of file renderer_GL_common.inl.
| #define END_UNTEXTURED_SEGMENTS | ( | x1, | |
| y1, | |||
| x2, | |||
| y2, | |||
| r, | |||
| g, | |||
| b, | |||
| a | |||
| ) |
Definition at line 3880 of file renderer_GL_common.inl.
| #define GET_ALPHA | ( | sdl_color | ) | ((sdl_color).unused) |
Definition at line 137 of file renderer_GL_common.inl.
| #define GPU_BLIT_BUFFER_ABSOLUTE_MAX_VERTICES 60000 |
Definition at line 76 of file renderer_GL_common.inl.
| #define GPU_BLIT_BUFFER_COLOR_OFFSET 4 |
Definition at line 88 of file renderer_GL_common.inl.
| #define GPU_BLIT_BUFFER_FLOATS_PER_VERTEX 8 |
Definition at line 82 of file renderer_GL_common.inl.
| #define GPU_BLIT_BUFFER_INIT_MAX_NUM_VERTICES (GPU_BLIT_BUFFER_VERTICES_PER_SPRITE*1000) |
Definition at line 72 of file renderer_GL_common.inl.
| #define GPU_BLIT_BUFFER_STRIDE (sizeof(float)*GPU_BLIT_BUFFER_FLOATS_PER_VERTEX) |
Definition at line 85 of file renderer_GL_common.inl.
| #define GPU_BLIT_BUFFER_TEX_COORD_OFFSET 2 |
Definition at line 87 of file renderer_GL_common.inl.
| #define GPU_BLIT_BUFFER_VERTEX_OFFSET 0 |
Definition at line 86 of file renderer_GL_common.inl.
| #define GPU_BLIT_BUFFER_VERTICES_PER_SPRITE 4 |
Definition at line 71 of file renderer_GL_common.inl.
| #define GPU_INDEX_BUFFER_ABSOLUTE_MAX_VERTICES 4000000000u |
Definition at line 78 of file renderer_GL_common.inl.
| #define intptr_t long |
Definition at line 15 of file renderer_GL_common.inl.
| #define LOOP_UNTEXTURED_SEGMENTS | ( | ) |
Definition at line 3874 of file renderer_GL_common.inl.
| #define M_PI 3.14159265358979323846 |
Definition at line 22 of file renderer_GL_common.inl.
| #define MAX | ( | a, | |
| b | |||
| ) | ((a) > (b)? (a) : (b)) |
Definition at line 5297 of file renderer_GL_common.inl.
| #define MIX_COLOR_COMPONENT | ( | a, | |
| b | |||
| ) | (((a)/255.0f * (b)/255.0f)*255) |
Definition at line 869 of file renderer_GL_common.inl.
| #define MIX_COLOR_COMPONENT_NORMALIZED_RESULT | ( | a, | |
| b | |||
| ) | ((a)/255.0f * (b)/255.0f) |
Definition at line 868 of file renderer_GL_common.inl.
| #define SDL_GPU_DISABLE_SHADERS |
Definition at line 209 of file renderer_GL_common.inl.
| #define SDL_Window SDL_Surface |
Definition at line 136 of file renderer_GL_common.inl.
| #define SET_COMMON_FUNCTIONS | ( | impl | ) |
Definition at line 6514 of file renderer_GL_common.inl.
| #define SET_INDEXED_VERTEX | ( | offset | ) | index_buffer[cdata->index_buffer_num_vertices++] = blit_buffer_starting_index + (offset); |
Definition at line 3852 of file renderer_GL_common.inl.
| #define SET_RELATIVE_INDEXED_VERTEX | ( | offset | ) | index_buffer[cdata->index_buffer_num_vertices++] = cdata->blit_buffer_num_vertices + (offset); |
Definition at line 3855 of file renderer_GL_common.inl.
| #define SET_TEXTURED_VERTEX | ( | x, | |
| y, | |||
| s, | |||
| t, | |||
| r, | |||
| g, | |||
| b, | |||
| a | |||
| ) |
Definition at line 3804 of file renderer_GL_common.inl.
| #define SET_TEXTURED_VERTEX_UNINDEXED | ( | x, | |
| y, | |||
| s, | |||
| t, | |||
| r, | |||
| g, | |||
| b, | |||
| a | |||
| ) |
Definition at line 3818 of file renderer_GL_common.inl.
| #define SET_UNTEXTURED_SEGMENTS | ( | x1, | |
| y1, | |||
| x2, | |||
| y2, | |||
| r, | |||
| g, | |||
| b, | |||
| a | |||
| ) |
Definition at line 3865 of file renderer_GL_common.inl.
| #define SET_UNTEXTURED_VERTEX | ( | x, | |
| y, | |||
| r, | |||
| g, | |||
| b, | |||
| a | |||
| ) |
Definition at line 3831 of file renderer_GL_common.inl.
| #define SET_UNTEXTURED_VERTEX_UNINDEXED | ( | x, | |
| y, | |||
| r, | |||
| g, | |||
| b, | |||
| a | |||
| ) |
Definition at line 3842 of file renderer_GL_common.inl.
| #define static_inline static inline |
Definition at line 30 of file renderer_GL_common.inl.
| static_inline void flushAndBindFramebuffer | ( | GPU_Renderer * | renderer, |
| GLuint | handle | ||
| ) |
Definition at line 482 of file renderer_GL_common.inl.
| static_inline void flushAndBindTexture | ( | GPU_Renderer * | renderer, |
| GLuint | handle | ||
| ) |
Definition at line 442 of file renderer_GL_common.inl.
| static_inline void flushAndClearBlitBufferIfCurrentFramebuffer | ( | GPU_Renderer * | renderer, |
| GPU_Target * | target | ||
| ) |
Definition at line 514 of file renderer_GL_common.inl.
| static_inline void flushAndClearBlitBufferIfCurrentTexture | ( | GPU_Renderer * | renderer, |
| GPU_Image * | image | ||
| ) |
Definition at line 499 of file renderer_GL_common.inl.
| static_inline void flushBlitBufferIfCurrentTexture | ( | GPU_Renderer * | renderer, |
| GPU_Image * | image | ||
| ) |
Definition at line 491 of file renderer_GL_common.inl.
| static_inline void get_drawable_dimensions | ( | SDL_Window * | window, |
| int * | w, | ||
| int * | h | ||
| ) |
Definition at line 157 of file renderer_GL_common.inl.
| static_inline GPU_bool get_fullscreen_state | ( | SDL_Window * | window | ) |
Definition at line 172 of file renderer_GL_common.inl.
| static_inline void get_target_drawable_dimensions | ( | GPU_Target * | target, |
| int * | w, | ||
| int * | h | ||
| ) |
Definition at line 195 of file renderer_GL_common.inl.
| static_inline void get_target_window_dimensions | ( | GPU_Target * | target, |
| int * | w, | ||
| int * | h | ||
| ) |
Definition at line 186 of file renderer_GL_common.inl.
| static_inline SDL_Window* get_window | ( | Uint32 | windowID | ) |
Definition at line 139 of file renderer_GL_common.inl.
| static_inline void get_window_dimensions | ( | SDL_Window * | window, |
| int * | w, | ||
| int * | h | ||
| ) |
Definition at line 149 of file renderer_GL_common.inl.
| static_inline Uint32 get_window_id | ( | SDL_Surface * | window | ) |
Definition at line 144 of file renderer_GL_common.inl.
| static_inline unsigned int getNearestPowerOf2 | ( | unsigned int | n | ) |
Definition at line 419 of file renderer_GL_common.inl.
| static_inline Uint32 getPixel | ( | SDL_Surface * | Surface, |
| int | x, | ||
| int | y | ||
| ) |
Definition at line 3486 of file renderer_GL_common.inl.
| static_inline GPU_bool has_colorkey | ( | SDL_Surface * | surface | ) |
Definition at line 177 of file renderer_GL_common.inl.
| static_inline GPU_bool isCurrentTarget | ( | GPU_Renderer * | renderer, |
| GPU_Target * | target | ||
| ) |
Definition at line 508 of file renderer_GL_common.inl.
| static_inline GPU_bool isPowerOfTwo | ( | unsigned int | x | ) |
Definition at line 414 of file renderer_GL_common.inl.
| static_inline void resize_window | ( | GPU_Target * | target, |
| int | w, | ||
| int | h | ||
| ) |
Definition at line 162 of file renderer_GL_common.inl.
| static_inline void submit_buffer_data | ( | int | bytes, |
| float * | values, | ||
| int | bytes_indices, | ||
| unsigned short * | indices | ||
| ) |
Definition at line 4452 of file renderer_GL_common.inl.
1.8.13