Commit Graph

527 Commits

Author SHA1 Message Date
Ray
84edd22612 Reviewed unsigned int issue (discussion #2054) 2021-10-15 11:25:17 +02:00
Ray
83b3478fe4 Reviewed some TODO 2021-10-13 23:45:57 +02:00
Ray
a91f61262e Review RLAPI to avoid warnings 2021-10-10 23:24:05 +02:00
8722ff7043 REVIEWED: RLGL.State.vertexCounter (See detailed comment)
`RLGL.State.vertexCounter` is a generic counter and it's reused for all `rlRenderBatch`, actually, once render batch is filled, required vertex count is provided through the draw calls, so, the total accumulated count of vertices is not directly registered inside the rlRenderBatch.

`RLGL.State.vertexCounter` keeps that count but one possible improvement(?) could be moving the `vertexCounter` inside `rlRenderBatch` to always keep a register of the total accumulated vertices in that batch (despite that info is provided by the accumulated `draws[i].vertexCount`.

Simplifying, `RLGL.State.vertexCounter = SUM(draws[i].vertexCount)`

The decision to move the counter out of `rlVertexBuffer` is to keep only the data that I think should belong to `rlVertexBuffer` and make it more generic, aligned with raylib `Mesh` structure.

The decision to not add it to `rlRenderBatch` is because it could contain multiple `rlVertexBuffer` and it would be confusing (because it would only register the count of the last filled one).
2021-10-06 11:44:57 +02:00
Ray
8d7f97ee04 Remove trailing spaces 2021-10-06 01:20:46 +02:00
Ray
9a4fb25285 REDESIGNED: Simplify vertex data recording
Instead of registering vertex texcoords and colors on every call, we keep the last defined value and we record everything on `glVertex*()`. Actually that behavior is aligned with OpenGL 1.1 standard.
2021-10-06 01:17:20 +02:00
b972b8d324 REVIEWED: API functions specifiers 2021-10-05 18:33:41 +02:00
Ray
f869229b7f Minor format tweaks 2021-10-03 12:09:59 +02:00
dfbb134bfe RLGL: restore draw batch state after limit check (#2018) 2021-09-29 23:26:29 +02:00
Ray
00a763ea44 Reviewed some TODO comments 2021-09-23 00:18:47 +02:00
Ray
9362eaf9c6 REVIEWED: Naming: length vs size 2021-09-01 23:40:51 +02:00
Ray
a0f8682905 REVIEWED: <name>Count for consistency
Following english rules, it should be singular name before Count.
2021-09-01 23:09:30 +02:00
Ray
14e443afba REVIEWED: OpenGL 1.1 compilation issue 2021-08-25 23:41:33 +02:00
Ray
a5beb940f8 Remove trailing spaces 2021-08-16 23:23:16 +02:00
Ray
f3385b6ad2 Update rlgl.h 2021-08-16 19:52:57 +02:00
Ray
ef8526ae36 Update rlgl.h 2021-08-16 19:26:10 +02:00
Ray
92a13878dc Add some comments 2021-08-16 19:23:06 +02:00
aae60e1e44 REVIEWED: extern "C" definition position for consistency
Note that `extern "C"` calling convention only affects objects that need to be seen by the linker, in our case only functions... but it would also be required by global variables exposed, if any.
2021-08-15 13:02:53 +02:00
1dff5814be ADDED: rlUpdateVertexBufferElements() #1915 2021-08-12 21:01:09 +02:00
26db391576 ADDED: rlActiveDrawBuffers() #1911
- ADDED: rlEnableColorBlend()/rlDisableColorBlend()
2021-08-12 20:38:57 +02:00
ce3214b82d [rlgl] rlUpdateVertexBuffer (#1914)
* GenMeshTangents Fix

* GenMeshTangents Fix - Comment Update

* GenMeshTangents Fix - Comment Update final

* Code Style Changes

* Code Style Changes Final

* Code Style Changes Final 2

* GenMeshTangents better handling for issue #1876

* GenMeshTangents better handling for issue #1876

* GenMeshTangents: Better fix for issue #1876

* vboId location fix

* rlUpdateVertexBuffer - bufferId is an unsigned int
2021-08-12 09:47:00 +02:00
aa67903f96 Improve rlgl description 2021-07-31 19:58:30 +02:00
5b6d83b533 REVIEWED: rlgl defines for consistency 2021-07-31 19:46:44 +02:00
3e75a2109d REVIEWED: rlgl module header info 2021-07-31 19:08:13 +02:00
b805754aa1 REVIEWED: Avoid bool type collisions 2021-07-31 18:10:26 +02:00
dffd1435e9 Revert "REVIEWED: Avoid UBSAN warnings #1891"
This reverts commit a8e9e1387f.
2021-07-30 13:50:33 +02:00
a8e9e1387f REVIEWED: Avoid UBSAN warnings #1891 2021-07-30 13:47:21 +02:00
b4fddf146b REVIEWED: Added new mechanism to avoid data types collision between modules that share same data types and can be used in standalone mode 2021-07-30 13:44:52 +02:00
aeb1a0da84 REVERTED: Removed the need for rlMatrix
Now rlgl uses the `Matrix` type, just make sure it has been previously defined somewhere... I don't like this approach but it's probably the easier one for the users... still looking for a better solution... maybe using something like
`#define MATRIX_TYPE`, so it can be checked in other modules.
2021-07-30 12:54:54 +02:00
bd70a22412 Review some issues 2021-07-30 11:56:14 +02:00
8b7f43f89b WARNING: BREAKING CHANGE: rlgl complete decoupling from raylib -WIP-
rlgl has been redesigned to avoid any dependency to `raylib` or `raymath`, all functions using some of those libs have been reviewed.
 - REMOVED: `Texture2D`, `Shader` structs dependency
 - REMOVED: `Vector3`, `Matrix` structs dependency
 - REMOVED: raymath functions dependency, all required math is implemented in rlgl
 - ADDED: `rlMatrix` custom rlgl type
 - ADDED: `utils.c`: `rlMatrixFromMatrix()` and `rlMatrixToMatrix()` for a safe conversion between raylib<->rlgl matrix types
 - ADDED: `rl` prefix to all `rlgl` structs
 - Other small tweaks here and there
2021-07-29 21:57:50 +02:00
96aadec503 REVIEWED: Info on image loading failure 2021-07-28 19:47:53 +02:00
e9c7ab925f REVIEWED: rlDrawVertexArrayElements() #1891 2021-07-27 23:35:54 +02:00
5ed814e950 Minor tweaks and comments 2021-07-09 17:36:20 +02:00
Ray
4b6e6ce20e REVIEWED: Improved log info on image/textures laoding
ADDED: rlGetPixelFormatName()
2021-06-26 13:07:14 +02:00
Ray
e0720a0a55 WARNING: REVIEWED: Default shader uniform names
When a shader is loaded, by default, several locations are tried to be set automatically.
2021-06-25 13:35:43 +02:00
Ray
d4c03b47ec REVIEWED: LoadShader() and default locations
Reviewed locations descriptions
2021-06-25 00:46:14 +02:00
Ray
942657fc7c Remove Color struct requirement 2021-06-17 00:28:51 +02:00
Ray
7bc2e922c9 Review some comments 2021-06-10 17:49:55 +02:00
Ray
b0dcdf688f Reviewed functions description
Replaced: Returns -> Get
2021-06-10 17:43:58 +02:00
Ray
8980bcfe4b Added some enum comments 2021-06-10 11:31:34 +02:00
e95d8bc655 Minor format tweaks 2021-06-05 12:33:05 +02:00
Ray
71995d52b3 REVIEWED: exit() on LOG_FATAL instead of LOG_ERROR #1796 2021-05-30 18:02:06 +02:00
Ray
03710c9d8e Some code tweaks for consistency 2021-05-22 16:54:04 +02:00
2565c01158 check for vao extension (#1757) 2021-05-08 18:24:14 +02:00
Ray
ffadeeeb84 Decoupling rlgl from platform layer
Now rlgl only depends on OpenGL and it's completely decoupled from platform layer libraries (EGL)
2021-04-28 23:57:46 +02:00
Ray
6ebe76cba7 Minor tweaks 2021-04-27 11:05:05 +02:00
0e2845ec26 Review OpenGL 1.1 building #1732
It works compiling with MinGW
2021-04-25 13:32:24 +02:00
Ray
581bd0eb02 Remove trailing spaces 2021-04-18 23:50:32 +02:00
Ray
223091f44c Review extensions issue on macOS 2021-04-18 20:33:49 +02:00