Commit Graph

334 Commits

Author SHA1 Message Date
0f10c44578 Fixes gl state after HDR texture functions. (#1621)
Updates skybox demo to show how to do both HDR and non HDR skyboxes

Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-02-28 23:31:25 +01:00
Ray
58e4efbba8 Review bug on OpenGL 1.1 2021-02-26 13:40:43 +01:00
Ray
ef8318f5e3 [models] Move vboId ALLOC/FREE to rlgl module #1603
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.
2021-02-21 12:09:52 +01:00
48a7cd3c87 [Examples] Fix typecast warnings in examples. (#1601)
* Fixing typecast warnings generated by visual studio 2019 in examples.

* Changes to fixes based on feedback

Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
2021-02-20 23:37:32 +01:00
2b1ec5d8d2 Review some comments 2021-02-14 16:46:33 +01:00
d93b8f6544 Fix spelling mistake (#1581)
Sorry if this is a bit of a useless pr
2021-02-09 22:29:01 +01:00
5663c81803 REVIEWED: raudio: Some LOG_ERROR -> LOG_WARNING #1562 2021-02-05 19:19:44 +01:00
4407533a41 REVIEWED: DecompressData(), memory reallocation 2021-02-05 13:52:01 +01:00
005bc4c414 REVIEWED: LoadShaderProgram() #1563
Try to avoid a possible false-positive memory leak...
2021-02-02 12:33:01 +01:00
f3ce3a6f74 Removing config.h.in file (#1546)
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.
2021-01-25 10:47:53 +01:00
Ray
bbc09288bd rlOrtho() reverted change 2021-01-09 12:37:21 +01:00
b76dc06297 It's top-bottom not bottom-top in GL space. (#1517) 2021-01-07 23:13:44 +01:00
a6cd6eedbe Remove unused condition in 'GenerateMipmaps' function for GRAPHICS_API_OPENGL_11 (#1496) 2021-01-06 13:27:32 +01:00
7bd33e4406 Review rlOrtho() to avoid return in the middle of the function
I usually try to avoid any return in the middle of functions, I try to keep them always at the end of the functions.
2021-01-06 13:26:55 +01:00
5d4aada526 Don't create an ortho matrix when the viewport is 0 in any axis. (#1504)
* 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
2021-01-06 13:21:58 +01:00
d7b4b9e485 Update year to 2021 2021-01-02 18:15:13 +01:00
d9a9bacb48 Review formatting 2020-12-23 20:30:00 +01:00
342d4faf14 Add options to set line width and aliasing to rlGL layer. (#1457)
* Add options to set line width and aliasing to rlGL layer.

* Don't do line smoothing in OpenGLES
2020-12-13 10:58:24 +01:00
039503e7c2 Add functions to enable/disable depth writes to go with functions for depth tests. (#1451) 2020-12-05 21:53:19 +01:00
Ray
700bff5fd8 Version tweak 2020-11-19 20:01:40 +01:00
Ray
a54d9f734b rlUpdateTexture(): Corrected issue 2020-11-16 15:18:05 +01:00
Ray
3e1cd487df Remove trailing spaces 2020-11-03 23:47:33 +01:00
Ray
8e15dae5ed Review contributed examples 2020-11-01 13:39:48 +01:00
Ray
fbc51e822b REDESIGNED: Multiple sampler2D usage on batch system
New implementation allow enabling additional textures per batch only.
2020-10-31 11:48:44 +01:00
Ray
8a16348131 Support multiple sample2D on batch drawing #1333 2020-10-29 20:22:52 +01:00
Ray
d99ac093d4 Support additional texture units for default batch system #1333
This path requires some testing...
2020-10-26 20:13:08 +01:00
Ray
d9e591f235 Review some comments 2020-10-26 20:11:58 +01:00
Ray
a850246030 Review Texture type
Texture type also maps to Texture2D and TextureCubemap
2020-09-28 00:40:32 +02:00
446f9fff00 Added note 2020-09-27 11:14:49 +02:00
4bcddc3b15 [wip] rlDrawMeshInstanced (#1318)
* rlDrawMeshInstanced first attempt

* rlDrawMeshInstanced OpenGL 3.3 and VAO checks

* rlDrawMeshInstanced GetShaderAttribLocation; comments

* example instanced shader

* RLGL_STANDALONE RAYMATH_STANDALONE Vector4

* apply suggested naming changes; add instanced mesh example

* remove orphan variables
2020-09-27 10:29:05 +02:00
c2e56f2604 REVIEW: GenTextureCubemap(), avoid using models.c functions
- DrawCube() belongs to models.c -> rl*() alternative should be used
2020-09-26 11:51:42 +02:00
eef82b04ac REVIEW: Replace rlglDraw() calls by DrawRenderBatch() internal calls 2020-09-25 18:19:19 +02:00
fe8bf2fa55 REVIEWED: GenTextureCubemap(), use rlgl functionality only
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.
2020-09-25 18:14:46 +02:00
032b2db398 REVIEWED: GenTextureCubemap()
Added some tracelog messages
2020-09-21 13:18:53 +02:00
b5d50ee51a EXAMPLE: models_skybox works on OpenGL ES 2.0 2020-09-18 20:47:39 +02:00
79d63e6ca1 Review comment 2020-09-18 16:44:28 +02:00
152665ff48 REDESIGNED: GenTexture*() #721
Functions have been redesigned to use rlgl and allow to externalize them (aka removing them from rlgl because they use custom shaders...).
2020-09-18 13:50:51 +02:00
ccda320be4 REVIEWED: rlFramebufferAttach() to support texture layers
Required to attach multiple color textures and multiple cubemap faces
2020-09-18 11:37:57 +02:00
04406c0f1a Corrected minor framebuffer issue on OpenGL ES 2.0 2020-09-18 02:14:05 +02:00
cdc8850e68 WARNING: REDESIGN of rlgl framebuffers API #721
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.
2020-09-18 02:11:49 +02:00
fa2c114636 WARNING: struct RenderTexture2D: Removed depthTexture
Not required anymore, attachment type is queried when required
2020-09-17 13:44:03 +02:00
cbdb9bfe42 REVIEWED: UnloadShader() issue
Avoid unloading default shader, raylib will take care of it
2020-09-16 16:33:17 +02:00
b870b9f828 Minor: remove tabs 2020-09-16 13:17:31 +02:00
90befff4b8 Make sure to detach data before deleting
Before deleting certain objects, they must be detached from their parents. That's the case for shader objects after linkage to shader program and also for the texture/cubemaps/renderbuffers attached to framebuffers. If objects are deleted before detached, they are kept in memory to avoid accessing deleted data.
2020-09-16 13:17:16 +02:00
c5c156d65e Review GenDrawCube() and GenDrawQuad()
Better organized and commented
2020-09-15 13:44:04 +02:00
0983d7b45c Solved issues when compiled for OpenGL 1.1 2020-09-15 11:30:20 +02:00
5073619962 REVIEWED: GetTextureData(), allow retrieving 32bit float data 2020-09-14 16:03:45 +02:00
1134024985 Update rlgl.h 2020-09-01 21:27:47 +02:00
05cdaf7d01 MOVED: rlUnproject() [rlgl] -> Vector3Unproject() [raymath] 2020-09-01 21:08:45 +02:00
a1422ba1c1 Review custom blend modes mechanism
rlBlendMode() has been added to rlgl to be used on BLEND_CUSTOM. This functionality is exposed to advance users.

In any case, new blending modes could be added if required.
2020-09-01 21:02:19 +02:00