Commit graph

389 commits

Author SHA1 Message Date
raysan5
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
raysan5
96aadec503 REVIEWED: Info on image loading failure 2021-07-28 19:47:53 +02:00
Ray
00911b0842 Reviewed ImageDrawLine() formating 2021-07-23 23:32:20 +02:00
Alexander Buhl
ff2b8d6db1
Fixes #1873 Implemented remaining 7/8 of ImageDrawLine (#1874)
* Implemented remaining 7/8 of ImageDrawLine

The existing code was correct for one octant, it now works for all 8
Added two internal functions, _ImageDrawLineHorizontal and _ImageDrawLineVertical, whithout which it would've been 4 times as much code.

* ImageDrawLine: Replaced 3 functions with 1

Removed both freshly added internal functions
Crammed it all into one

* ImageDrawLine shortened significantly using maths

Substituted X and Y, then wrote one abstract loop instead of 4 specific loops.
Lots of comments to explain what I'm doing for future maintainers.

* Now conforms with style conventions

Also reworded a comment to sound more... fomal.
2021-07-23 23:17:04 +02:00
raysan5
9e7ca41f58 Remove trailing spaces 2021-06-30 16:39:07 +02:00
Ray
e5cf3f9555 WARNING: BREAKING: Functions renamed for consistency
RENAMED: GetTextureData() -> LoadImageFromTexture()
RENAMED: GetScreenData() -> LoadImageFromScreen()
2021-06-28 09:39:31 +02:00
Ray
4b6e6ce20e REVIEWED: Improved log info on image/textures laoding
ADDED: rlGetPixelFormatName()
2021-06-26 13:07:14 +02:00
Ray
3db26f82ea WARNING: BREAKING: Functions renamed!
RENAMED: GetCodepoints() -> LoadCodepoints(), now codepoint array data is loaded dynamically instead of reusing a limited static buffer.
ADDED: UnloadCodepoints() to safely free loaded codepoints
RENAMED: GetNextCodepoint() -> GetCodepoint()
2021-06-23 09:58:49 +02:00
Ray
4b93feb172 Remove trail spaces 2021-06-13 17:08:30 +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
raysan5
e95d8bc655 Minor format tweaks 2021-06-05 12:33:05 +02:00
Ray
89e734de6b Review config flags #1784 2021-05-30 22:31:14 +02:00
Ray
0369ec9adf Some code tweaks 2021-05-30 11:50:32 +02:00
Ray
4a099c3658 Review ExportImage() to use SaveFileData() #1779 2021-05-20 20:37:46 +02:00
Ray
581bd0eb02 Remove trailing spaces 2021-04-18 23:50:32 +02:00
Ergoold
85ef9d8f2e
Fix ImageClearBackground (#1711)
- Dividing by height instead of width results in missing parts of the image.
2021-04-07 00:02:37 +02:00
raysan5
a8dd4127f3 Added security check to avoid internal render batch overflow 2021-04-05 13:59:52 +02:00
raysan5
66f3434571 REDESIGNED: Shapes texture/rec moved to shapes module 2021-04-04 14:59:17 +02:00
raysan5
ccdf7ff335 REDESIGN: Move GenTexture*() functions to PBR example #721
Removed functions from rlgl module.
2021-04-02 14:29:33 +02:00
raysan5
aed0fee2ca Remove trailing spaces 2021-04-01 20:24:33 +02:00
raysan5
bc6b16beb2 REVIEWED: DrawTexturePoly() 2021-03-28 20:07:59 +02:00
Ray
cba412cc31 WARNING: BREAKING: rlgl redesign -WIP-
rlgl module has been completely redesigned to move Mesh/Material structures to [models] module. Still some work to do, broken elements:
 - [models] OpenGL 1.1 mesh rendering: DrawMesh()
 - [models] Mesh Instancing: DrawMeshInstanced()
 - [models] Stereo rendering: DrawMesh()
 - [models] GL_FLOAT, GL_UNSIGNED_INT exposed
 - [models] GenMeshCustom()
 - [rlgl] GenTexture*() functions removal?
2021-03-25 14:28:12 +01:00
chriscamacho
9569d6a802
Add DrawTexturedPoly and example (#1677)
* adds DrawTexturedPoly with example

* the actual example ... ahem

* moved DrawTexturePoly to textures function and example
NB function name changed to fit with other DrawTextureXXX functions
(no "d" )

Co-authored-by: codifies <you@example.com>
2021-03-25 14:22:10 +01:00
Ray
9047025ab7 Update textures.c 2021-03-24 00:41:01 +01:00
Chris
2532c396ed
Fix 90 degree bug with DrawTexturePro and DrawRectanglePro (#1673)
- The vertices did not map to where I expected causing rotation to be
off by 90 degrees. I reorganized the vertices making it easier to
reason about which fixes this.
- The order for drawing is now topLeft, bottomLeft, bottomRight,
topRight.
2021-03-23 14:40:26 +01:00
Ray
2ce28f75ad WARNING: BREAKING: REDESIGNED: rlgl module
- Many functions renamed to follow rl*() convention
- Some internal functions exposed in the API
- Some functionality moved to other modules
- Reorganized all functions by categories
- Make sure it keeps working with OpenGL 1.1 and 2.1
2021-03-22 20:45:04 +01:00
Ray
9909068714 Removed trailing spaces 2021-03-19 19:43:44 +01:00
Ray
e28f754fbe Reviewed latest PR: formatting and some comments 2021-03-19 19:42:36 +01:00
Chris
45670fbf2d
Optimize DrawTexturePro and DrawRectanglePro transformations (#1632)
* Optimize DrawTexturePro and DrawRectanglePro transformations
- Add check so rotation is only applied if rotation != 0.0f.
- Replace matrix usage by calculating the vertex data directly.

* Fix error with windows build and trim whitespace
2021-03-19 19:19:10 +01:00
Ray
a1d9987e7c WARNING: BREAKING: REVIEWED some enums naming
Now enum names are more consistent between them.
2021-03-19 13:19:54 +01:00
Ray
1cc838cef4 Update textures.c 2021-03-17 19:37:03 +01:00
Ray
01e28263be WARNING: VERY BREAKING CHANGE: Renamed some enum values for consistency
Some enums values have been renamed to be more consistent and also provide a more detailed description:
 - ShaderLocationIndex:    LOC_VERTEX_POSITION -> SHADER_SHADER_LOC_VERTEX_POSITION
 - ShaderUniformDataType:  UNIFORM_VEC2 -> SHADER_UNIFORM_VEC2
 - MaterialMapType: MAP_ALBEDO -> MATERIAL_MAP_ALBEDO
 - PixelFormat: UNCOMPRESSED_GRAYSCALE -> PIXELFORMAT_UNCOMPRESSED_GRAYSCALE
2021-03-14 11:05:51 +01:00
Ray
b084552808 ADDED: Config flag: SUPPORT_STANDARD_FILEIO
This new flag allows omitting stdio.h library in case of a custom implementation is used.
2021-03-04 20:36:04 +01:00
Ray
c938d71d15 Corrected issue with enums renamed 2021-03-03 19:51:23 +01:00
Ray
dfe797060a WARNING: BREAKING: RENAMED: enums values
RENAMED: TextureFilterMode values
RENAMED: TextureWrapMode values
2021-03-03 19:47:37 +01:00
Ray
408f5aedb8 WARNING: BREAKING: RENAMED enum values
RENAMED: CubemapLayoutType and NPatchType
2021-03-03 19:36:28 +01:00
Ray
bcc4418ff0 REVIEWED: GetFileExtension() to include the dot #1523 2021-03-02 01:07:08 +01:00
raysan5
d7b4b9e485 Update year to 2021 2021-01-02 18:15:13 +01:00
raysan5
9ed29725a0 Review code formatting 2020-12-29 20:42:29 +01:00
Jeffery Myers
59bb759855
Faster version of ImageClearBackground and ImageDrawRectangleRec (#1487)
* Don't use DrawRect to clear an image, a pixel loop is an order of magnitude faster.

* Update ImageDrawRectangle to be faster too.
2020-12-29 20:39:53 +01:00
raysan5
0a9e080998 Remove trailing spaces 2020-12-23 15:03:26 +01:00
Ray
2374281204 Avoid *Rec suffix in some variables
Pefixing/Suffixing some data type identifier in the variables is not a convention used in raylib, just reviewed it for consistency...

Still, I kept the *Rec suffix in some functions.
2020-12-19 19:27:31 +01:00
Ray
c36a6f3d9f Update textures.c 2020-12-19 00:01:14 +01:00
Ray
e07bc372a1 WARNING: RENAMED several functions for consistency #1440
This is a BREAKING CHANGE!

To address the linked issue, several functions have been renamed and couterpart functions have been created to free loaded memory:
 - RENAMED: GetImageData() -> LoadImageColors()
 - RENAMED: GetImagePalette() -> LoadImagePalette()
 - RENAMED: GetWaveData() -> LoadWaveSamples()
 - ADDED: UnloadImageColors()
 - ADDED: UnloadImagePalette()
 - ADDED: UnloadWaveSamples()
2020-12-18 21:03:08 +01:00
Andrea Fontana
ef0dcaabf9
Changing JPG compression (#1463)
Since I don't think the purpose of raylib is to save space compressing image, I think it could be a good idea to keep quality from 90 to 100.
2020-12-16 19:07:18 +01:00
Jeffery Myers
df249f5513
Fix typecast warnings in raylib code as reported by visual studio 2019 (#1443) 2020-11-30 08:14:11 +01:00
raysan5
d6f4f3ee88 REMOVED: GetImageDataNormalized()
Let the advance users manage it as they want...
2020-11-28 19:11:31 +01:00
Ray
bb9d734f69 Exposing some file access results to user layer #1420 2020-11-22 00:10:16 +01:00
Ray
72e51cd6de Review formating 2020-11-19 20:06:35 +01:00