aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2017-04-22 22:35:04 +0200
committerraysan5 <raysan5@gmail.com>2017-04-22 22:35:04 +0200
commit247da006ae81ee66fe0239a1c9bbbfcb0f79aa6f (patch)
tree8c8a1266eb7295561d7d4a164d28609785dd4759 /src
parentb0f8ea27e3d7417c0f0c9795aa315dac399c97bf (diff)
downloadraylib-247da006ae81ee66fe0239a1c9bbbfcb0f79aa6f.tar.gz
raylib-247da006ae81ee66fe0239a1c9bbbfcb0f79aa6f.zip
Rename parameter
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.c20
-rw-r--r--src/rlgl.h2
2 files changed, 11 insertions, 11 deletions
diff --git a/src/rlgl.c b/src/rlgl.c
index 3b23d91a..b336571f 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -1331,7 +1331,7 @@ Vector3 rlglUnproject(Vector3 source, Matrix proj, Matrix view)
}
// Convert image data to OpenGL texture (returns OpenGL valid Id)
-unsigned int rlglLoadTexture(void *data, int width, int height, int textureFormat, int mipmapCount)
+unsigned int rlglLoadTexture(void *data, int width, int height, int format, int mipmapCount)
{
glBindTexture(GL_TEXTURE_2D, 0); // Free any old binding
@@ -1339,39 +1339,39 @@ unsigned int rlglLoadTexture(void *data, int width, int height, int textureForma
// Check texture format support by OpenGL 1.1 (compressed textures not supported)
#if defined(GRAPHICS_API_OPENGL_11)
- if (textureFormat >= 8)
+ if (format >= COMPRESSED_DXT1_RGB)
{
TraceLog(WARNING, "OpenGL 1.1 does not support GPU compressed texture formats");
return id;
}
#endif
- if ((!texCompDXTSupported) && ((textureFormat == COMPRESSED_DXT1_RGB) || (textureFormat == COMPRESSED_DXT1_RGBA) ||
- (textureFormat == COMPRESSED_DXT3_RGBA) || (textureFormat == COMPRESSED_DXT5_RGBA)))
+ if ((!texCompDXTSupported) && ((format == COMPRESSED_DXT1_RGB) || (format == COMPRESSED_DXT1_RGBA) ||
+ (format == COMPRESSED_DXT3_RGBA) || (format == COMPRESSED_DXT5_RGBA)))
{
TraceLog(WARNING, "DXT compressed texture format not supported");
return id;
}
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
- if ((!texCompETC1Supported) && (textureFormat == COMPRESSED_ETC1_RGB))
+ if ((!texCompETC1Supported) && (format == COMPRESSED_ETC1_RGB))
{
TraceLog(WARNING, "ETC1 compressed texture format not supported");
return id;
}
- if ((!texCompETC2Supported) && ((textureFormat == COMPRESSED_ETC2_RGB) || (textureFormat == COMPRESSED_ETC2_EAC_RGBA)))
+ if ((!texCompETC2Supported) && ((format == COMPRESSED_ETC2_RGB) || (format == COMPRESSED_ETC2_EAC_RGBA)))
{
TraceLog(WARNING, "ETC2 compressed texture format not supported");
return id;
}
- if ((!texCompPVRTSupported) && ((textureFormat == COMPRESSED_PVRT_RGB) || (textureFormat == COMPRESSED_PVRT_RGBA)))
+ if ((!texCompPVRTSupported) && ((format == COMPRESSED_PVRT_RGB) || (format == COMPRESSED_PVRT_RGBA)))
{
TraceLog(WARNING, "PVRT compressed texture format not supported");
return id;
}
- if ((!texCompASTCSupported) && ((textureFormat == COMPRESSED_ASTC_4x4_RGBA) || (textureFormat == COMPRESSED_ASTC_8x8_RGBA)))
+ if ((!texCompASTCSupported) && ((format == COMPRESSED_ASTC_4x4_RGBA) || (format == COMPRESSED_ASTC_8x8_RGBA)))
{
TraceLog(WARNING, "ASTC compressed texture format not supported");
return id;
@@ -1399,7 +1399,7 @@ unsigned int rlglLoadTexture(void *data, int width, int height, int textureForma
// GL_RGBA8 GL_RGBA GL_UNSIGNED_BYTE
// GL_RGB8 GL_RGB GL_UNSIGNED_BYTE
- switch (textureFormat)
+ switch (format)
{
case UNCOMPRESSED_GRAYSCALE:
{
@@ -1440,7 +1440,7 @@ unsigned int rlglLoadTexture(void *data, int width, int height, int textureForma
}
#elif defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_ES2)
// NOTE: on OpenGL ES 2.0 (WebGL), internalFormat must match format and options allowed are: GL_LUMINANCE, GL_RGB, GL_RGBA
- switch (textureFormat)
+ switch (format)
{
case UNCOMPRESSED_GRAYSCALE: glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, (unsigned char *)data); break;
case UNCOMPRESSED_GRAY_ALPHA: glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, width, height, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, (unsigned char *)data); break;
diff --git a/src/rlgl.h b/src/rlgl.h
index a870a907..f3fd6b22 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -366,7 +366,7 @@ void rlglClose(void); // De-init rlgl
void rlglDraw(void); // Draw VAO/VBO
void rlglLoadExtensions(void *loader); // Load OpenGL extensions
-unsigned int rlglLoadTexture(void *data, int width, int height, int textureFormat, int mipmapCount); // Load texture in GPU
+unsigned int rlglLoadTexture(void *data, int width, int height, int format, int mipmapCount); // Load texture in GPU
RenderTexture2D rlglLoadRenderTexture(int width, int height); // Load a texture to be used for rendering (fbo with color and depth attachments)
void rlglUpdateTexture(unsigned int id, int width, int height, int format, const void *data); // Update GPU texture with new data
void rlglGenerateMipmaps(Texture2D *texture); // Generate mipmap data for selected texture