update rlgl.h
This commit is contained in:
parent
c7fa9a0fa2
commit
c9338481a4
68
src/rlgl.h
68
src/rlgl.h
|
|
@ -159,7 +159,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Security check in case multiple GRAPHICS_API_OPENGL_* defined
|
// 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)
|
#if defined(GRAPHICS_API_OPENGL_21)
|
||||||
#undef GRAPHICS_API_OPENGL_21
|
#undef GRAPHICS_API_OPENGL_21
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -174,6 +174,11 @@
|
||||||
#endif
|
#endif
|
||||||
#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
|
// OpenGL 2.1 uses most of OpenGL 3.3 Core functionality
|
||||||
// WARNING: Specific parts are checked with #if defines
|
// WARNING: Specific parts are checked with #if defines
|
||||||
#if defined(GRAPHICS_API_OPENGL_21)
|
#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 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 bool rlFramebufferComplete(unsigned int id); // Verify framebuffer is complete
|
||||||
RLAPI void rlUnloadFramebuffer(unsigned int id); // Delete framebuffer from GPU
|
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
|
// Shaders management
|
||||||
RLAPI unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings
|
RLAPI unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings
|
||||||
|
|
@ -833,24 +842,29 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(GRAPHICS_API_OPENGL_11)
|
#if defined(GRAPHICS_API_OPENGL_11)
|
||||||
#if defined(__APPLE__)
|
#if defined(GRAPHICS_API_OPENGL_11_SOFTWARE)
|
||||||
#include <OpenGL/gl.h> // OpenGL 1.1 library for OSX
|
#define RLSW_IMPL
|
||||||
#include <OpenGL/glext.h> // OpenGL extensions library
|
#include <rlsw.h> // OpenGL 1.1 software implementation
|
||||||
#else
|
#else
|
||||||
// APIENTRY for OpenGL function pointer declarations is required
|
#if defined(__APPLE__)
|
||||||
#if !defined(APIENTRY)
|
#include <OpenGL/gl.h> // OpenGL 1.1 library for OSX
|
||||||
#if defined(_WIN32)
|
#include <OpenGL/glext.h> // OpenGL extensions library
|
||||||
#define APIENTRY __stdcall
|
#else
|
||||||
#else
|
// APIENTRY for OpenGL function pointer declarations is required
|
||||||
#define APIENTRY
|
#if !defined(APIENTRY)
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#define APIENTRY __stdcall
|
||||||
|
#else
|
||||||
|
#define APIENTRY
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
// WINGDIAPI definition. Some Windows OpenGL headers need it
|
||||||
|
#if !defined(WINGDIAPI) && defined(_WIN32)
|
||||||
|
#define WINGDIAPI __declspec(dllimport)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
// WINGDIAPI definition. Some Windows OpenGL headers need it
|
|
||||||
#if !defined(WINGDIAPI) && defined(_WIN32)
|
|
||||||
#define WINGDIAPI __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <GL/gl.h> // OpenGL 1.1 library
|
#include <GL/gl.h> // OpenGL 1.1 library
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -2310,6 +2324,10 @@ void rlglInit(int width, int height)
|
||||||
glShadeModel(GL_SMOOTH); // Smooth shading between vertex (vertex colors interpolation)
|
glShadeModel(GL_SMOOTH); // Smooth shading between vertex (vertex colors interpolation)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(GRAPHICS_API_OPENGL_11_SOFTWARE)
|
||||||
|
swInit(width, height);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||||
// Store screen size into global variables
|
// Store screen size into global variables
|
||||||
RLGL.State.framebufferWidth = width;
|
RLGL.State.framebufferWidth = width;
|
||||||
|
|
@ -2336,6 +2354,10 @@ void rlglClose(void)
|
||||||
glDeleteTextures(1, &RLGL.State.defaultTextureId); // Unload default texture
|
glDeleteTextures(1, &RLGL.State.defaultTextureId); // Unload default texture
|
||||||
TRACELOG(RL_LOG_INFO, "TEXTURE: [ID %i] Default texture unloaded successfully", RLGL.State.defaultTextureId);
|
TRACELOG(RL_LOG_INFO, "TEXTURE: [ID %i] Default texture unloaded successfully", RLGL.State.defaultTextureId);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(GRAPHICS_API_OPENGL_11_SOFTWARE)
|
||||||
|
swClose();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load OpenGL extensions
|
// Load OpenGL extensions
|
||||||
|
|
@ -3673,6 +3695,20 @@ void *rlReadTexturePixels(unsigned int id, int width, int height, int format)
|
||||||
return pixels;
|
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)
|
// Read screen pixel data (color buffer)
|
||||||
unsigned char *rlReadScreenPixels(int width, int height)
|
unsigned char *rlReadScreenPixels(int width, int height)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user