update rlgl.h
This commit is contained in:
parent
c7fa9a0fa2
commit
c9338481a4
38
src/rlgl.h
38
src/rlgl.h
|
|
@ -159,7 +159,7 @@
|
|||
#endif
|
||||
|
||||
// Security check in case multiple GRAPHICS_API_OPENGL_* defined
|
||||
#if defined(GRAPHICS_API_OPENGL_11)
|
||||
#if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_11_SOFTWARE)
|
||||
#if defined(GRAPHICS_API_OPENGL_21)
|
||||
#undef GRAPHICS_API_OPENGL_21
|
||||
#endif
|
||||
|
|
@ -174,6 +174,11 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
// Software implementation uses OpenGL 1.1 functionality
|
||||
#if defined(GRAPHICS_API_OPENGL_11_SOFTWARE)
|
||||
#define GRAPHICS_API_OPENGL_11
|
||||
#endif
|
||||
|
||||
// OpenGL 2.1 uses most of OpenGL 3.3 Core functionality
|
||||
// WARNING: Specific parts are checked with #if defines
|
||||
#if defined(GRAPHICS_API_OPENGL_21)
|
||||
|
|
@ -767,6 +772,10 @@ RLAPI unsigned int rlLoadFramebuffer(void); // Loa
|
|||
RLAPI void rlFramebufferAttach(unsigned int fboId, unsigned int texId, int attachType, int texType, int mipLevel); // Attach texture/renderbuffer to a framebuffer
|
||||
RLAPI bool rlFramebufferComplete(unsigned int id); // Verify framebuffer is complete
|
||||
RLAPI void rlUnloadFramebuffer(unsigned int id); // Delete framebuffer from GPU
|
||||
#if defined(GRAPHICS_API_OPENGL_11_SOFTWARE)
|
||||
RLAPI void* rlGetFramebuffer(int* width, int* height);
|
||||
RLAPI void rlResizeFramebuffer(int width, int height);
|
||||
#endif
|
||||
|
||||
// Shaders management
|
||||
RLAPI unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings
|
||||
|
|
@ -833,6 +842,10 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad
|
|||
#endif
|
||||
|
||||
#if defined(GRAPHICS_API_OPENGL_11)
|
||||
#if defined(GRAPHICS_API_OPENGL_11_SOFTWARE)
|
||||
#define RLSW_IMPL
|
||||
#include <rlsw.h> // OpenGL 1.1 software implementation
|
||||
#else
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h> // OpenGL 1.1 library for OSX
|
||||
#include <OpenGL/glext.h> // OpenGL extensions library
|
||||
|
|
@ -853,6 +866,7 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad
|
|||
#include <GL/gl.h> // OpenGL 1.1 library
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(GRAPHICS_API_OPENGL_33)
|
||||
#define GLAD_MALLOC RL_MALLOC
|
||||
|
|
@ -2310,6 +2324,10 @@ void rlglInit(int width, int height)
|
|||
glShadeModel(GL_SMOOTH); // Smooth shading between vertex (vertex colors interpolation)
|
||||
#endif
|
||||
|
||||
#if defined(GRAPHICS_API_OPENGL_11_SOFTWARE)
|
||||
swInit(width, height);
|
||||
#endif
|
||||
|
||||
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||
// Store screen size into global variables
|
||||
RLGL.State.framebufferWidth = width;
|
||||
|
|
@ -2336,6 +2354,10 @@ void rlglClose(void)
|
|||
glDeleteTextures(1, &RLGL.State.defaultTextureId); // Unload default texture
|
||||
TRACELOG(RL_LOG_INFO, "TEXTURE: [ID %i] Default texture unloaded successfully", RLGL.State.defaultTextureId);
|
||||
#endif
|
||||
|
||||
#if defined(GRAPHICS_API_OPENGL_11_SOFTWARE)
|
||||
swClose();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Load OpenGL extensions
|
||||
|
|
@ -3673,6 +3695,20 @@ void *rlReadTexturePixels(unsigned int id, int width, int height, int format)
|
|||
return pixels;
|
||||
}
|
||||
|
||||
#if defined(GRAPHICS_API_OPENGL_11_SOFTWARE)
|
||||
|
||||
void* rlGetFramebuffer(int* width, int* height)
|
||||
{
|
||||
return swGetColorBuffer(&width, &height);
|
||||
}
|
||||
|
||||
void rlResizeFramebuffer(int width, int height)
|
||||
{
|
||||
swResizeFramebuffer(width, height);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Read screen pixel data (color buffer)
|
||||
unsigned char *rlReadScreenPixels(int width, int height)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user