Actually, it seems more logical that rlgl takes care of OpenGL data than the models module...
Also, models module loaded vertex data is unloaded by models module.
* Fixing typecast warnings generated by visual studio 2019 in examples.
* Changes to fixes based on feedback
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
CMake relied on this file for configurations and also was interfering in the regular config.h by having a separate definition if building with CMake. This was not entirely correct so instead we will define compile time definitions separately through CMake (CompileDefinitions.cmake) and also will use the provided EXTERNAL_CONFIG_FLAGS that I found that will not use config.h in through the build process.
I also introduced a new compiler option (CUSTOMIZE_BUILD) that when OFF will use the default config.h and when ON will show other options for redefining your own options.
Fixed an error in rlgl.h where if you have both RLGL_STANDALONE and SUPPORT_VR_SIMULATOR you get a compile time error.
* Don't create an ortho matrix when the viewport is 0 in any axis.
Not all compilers divide by 0 and return inf, some segfault.
The matrix is not used by anything when minimized, so it just needs to not be called.
* Better fix that always ensures the rlgl matrix is always valid
* Better fix that always ensures the rlgl matrix is always valid
Function has been reviewed to avoid any direct OpenGL call and use rlgl functionality, also, GenDrawCube() has been replaced by the internal batch system with DrawCube().
WARNING: rlEnableTexture() call must be issued after enabling the current framebuffer when using batch mechanism because it includes a set of security checks to avoid batch overflow and push/pop matrix operations.
This redesign allows more flexibility when creating RenderTexture and a simplification (and hopefully removal) of `GenTexture*()` functions, that should not belong to this model but the user code, due to the use of custom shaders.
Also, this new API opens the door for a possible GBuffers type and advance rendering possibilities...
Some functions of the API have been also simplified or even removed.
rlgl module can be used as an standalone library, so, a version for the library has been added: v3.1.0, matching current raylib version.