mirror of
https://github.com/raysan5/raylib.git
synced 2026-04-15 11:39:09 -04:00
Code gardening
This commit is contained in:
12
src/rlgl.h
12
src/rlgl.h
@ -43,7 +43,7 @@
|
||||
* #define RLGL_ENABLE_OPENGL_DEBUG_CONTEXT
|
||||
* Enable debug context (only available on OpenGL 4.3)
|
||||
*
|
||||
* rlgl capabilities could be customized just defining some internal
|
||||
* rlgl capabilities could be customized defining some internal
|
||||
* values before library inclusion (default values listed):
|
||||
*
|
||||
* #define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 8192 // Default internal render batch elements limits
|
||||
@ -396,7 +396,7 @@ typedef struct rlVertexBuffer {
|
||||
|
||||
// Draw call type
|
||||
// NOTE: Only texture changes register a new draw, other state-change-related elements are not
|
||||
// used at this moment (vaoId, shaderId, matrices), raylib just forces a batch draw call if any
|
||||
// used at this moment (vaoId, shaderId, matrices), raylib forces a batch draw call if any
|
||||
// of those state-change happens (this is done in core module)
|
||||
typedef struct rlDrawCall {
|
||||
int mode; // Drawing mode: LINES, TRIANGLES, QUADS
|
||||
@ -478,7 +478,7 @@ typedef enum {
|
||||
// NOTE 1: Filtering considers mipmaps if available in the texture
|
||||
// NOTE 2: Filter is accordingly set for minification and magnification
|
||||
typedef enum {
|
||||
RL_TEXTURE_FILTER_POINT = 0, // No filter, just pixel approximation
|
||||
RL_TEXTURE_FILTER_POINT = 0, // No filter, pixel approximation
|
||||
RL_TEXTURE_FILTER_BILINEAR, // Linear filtering
|
||||
RL_TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps)
|
||||
RL_TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x
|
||||
@ -3356,7 +3356,7 @@ unsigned int rlLoadTexture(const void *data, int width, int height, int format,
|
||||
}
|
||||
|
||||
// Texture parameters configuration
|
||||
// NOTE: glTexParameteri does NOT affect texture uploading, just the way it's used
|
||||
// NOTE: glTexParameteri does NOT affect texture uploading
|
||||
#if defined(GRAPHICS_API_OPENGL_ES2)
|
||||
// NOTE: OpenGL ES 2.0 with no GL_OES_texture_npot support (i.e. WebGL) has limited NPOT support, so CLAMP_TO_EDGE must be used
|
||||
if (RLGL.ExtSupported.texNPOT)
|
||||
@ -3741,7 +3741,7 @@ void *rlReadTexturePixels(unsigned int id, int width, int height, int format)
|
||||
// Two possible Options:
|
||||
// 1 - Bind texture to color fbo attachment and glReadPixels()
|
||||
// 2 - Create an fbo, activate it, render quad with texture, glReadPixels()
|
||||
// Using Option 1, just need to care for texture format on retrieval
|
||||
// Using Option 1, care for texture format on retrieval
|
||||
// NOTE: This behaviour could be conditioned by graphic driver...
|
||||
unsigned int fboId = rlLoadFramebuffer();
|
||||
|
||||
@ -4199,7 +4199,7 @@ unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode)
|
||||
if (fsCode != NULL) fragmentShaderId = rlCompileShader(fsCode, GL_FRAGMENT_SHADER);
|
||||
else fragmentShaderId = RLGL.State.defaultFShaderId;
|
||||
|
||||
// In case vertex and fragment shader are the default ones, no need to recompile, just assign the default shader program id
|
||||
// In case vertex and fragment shader are the default ones, no need to recompile, assign the default shader program id
|
||||
if ((vertexShaderId == RLGL.State.defaultVShaderId) && (fragmentShaderId == RLGL.State.defaultFShaderId)) id = RLGL.State.defaultShaderId;
|
||||
else if ((vertexShaderId > 0) && (fragmentShaderId > 0))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user