Commit Graph
507 Commits
Author SHA1 Message Date
Chris Thrasher bb8a261bb8 Add tests for sfColor 2024-12-22 17:28:57 -06:00
Chris Thrasher b3e6e23ffd Add tests for sfBlendMode 2024-12-22 17:28:57 -06:00
Chris Thrasher e46663cf38 Add tests for sfRect 2024-12-22 17:28:57 -06:00
Chris Thrasher e7a41e864f Add tests for Audio module 2024-12-22 17:05:49 -06:00
Chris Thrasher ae540e2396 Fix README typo 2024-12-22 14:58:58 -06:00
Chris Thrasher 14e06ccea4 Centrally define SFML version 2024-12-21 20:38:26 -06:00
Chris Thrasher a185b440ef Use SFML 3.0.0 tag 2024-12-21 19:08:15 -06:00
Chris Thrasher 14378de263 Upgrade to clang-format-17 2024-11-01 15:03:09 -06:00
Lukas Dürrenberger 1fa7f3caec Add GitHub Sponsors and OpenCollective buttons 2024-10-10 19:30:35 +02:00
ZXShady b99a455873 Match parameter types with SFML types 2024-10-07 18:48:53 -06:00
Chris Thrasher d1708cbd65 Remove unused headers 2024-10-06 23:20:54 +02:00
Chris Thrasher a14d4322ac Remove references to sf:: types in public documentation 2024-10-06 23:20:19 +02:00
Chris Thrasher 5385f329c6 Clean up IpAddress implementation 2024-10-06 14:22:41 -06:00
Miron Alexandru fd8e6a0364 Align sfRenderStates with sf::RenderStates 2024-10-06 13:25:05 -06:00
ZXShady 884dcde3c3 Make enumeration counts constant expressions
This change allows now having these variables as array sizes that
are not Variable Length Arrays like in structs for example.

To note however that this changes the type from unsigned int to an
implementation defined type which usually `int` which is signed and
not unsigned.
2024-10-04 09:05:55 -06:00
ZXShady cc92ca36b7 Pass by reference if it is never null
sfEvent was not checked for null and was assumed to be non null in convertEvent so I made it a reference to reflect that
2024-10-03 10:42:15 -06:00
ZXShady 556ca510d4 Make ConvertEvent.hpp file in window module folder.
It is a window related module it makes more sense imo for it to be in it.

I also addded it to the cmake file so it appears in VIsual Studio
2024-10-03 10:33:51 -06:00
ZXShady 66e7af4993 check malloc return value for NULL and update docs
`sfFtpDirectoryResponse_getDirectory` can fail and return NULL becuase 'strdup' returns null on failure but `sfFtpDirectoryResponse_getDirectoryUnicode` didn't and just had UB due not checking return value of malloc.

typing NULL in the docs made me age 30 years btw
2024-09-29 11:51:53 -06:00
Chris Thrasher 6ce8f95553 Remove unnecessary static_casts 2024-09-28 21:20:14 -06:00
ZXShady b626f65ee5 Cast to larger type before doing arithmetic to avoid signed integer overflow
https://godbolt.org/z/soTad4zEq

this godbolt links shows that it is UB to multiply then cast if the amount is large enough
2024-09-28 19:45:28 -06:00
ZXShady f297287951 make static varaibles const via lamdbas
this pr also makes `sfSoundRecorder_getAvailableDevices` return a const pointer to a const char pointer so you can no longer modify where the pointers of the strings are pointing into becuase it doesn't make sense.
2024-09-28 19:21:25 -06:00
ZXShady ef81fbd337 use aggregate initialization 2024-09-27 18:42:48 -06:00
ZXShady 84f580e207 remove cstyle default init 2024-09-27 17:57:02 -06:00
ZXShady 4c818c31ed make sfTime const global variable 2024-09-27 15:11:41 -06:00
ZXShady 82e4518e93 remove unnecessary boolean comparson != 0 2024-09-27 14:41:21 -06:00
Chris Thrasher b8860362a3 Remove reference to C++ standard library 2024-09-27 14:19:37 -06:00
Chris Thrasher 37e78942ed Use functions from the C++ standard library 2024-09-27 14:19:37 -06:00
Chris Thrasher c74378bade Update enumerations to match SFML 3 2024-09-27 13:24:31 -06:00
Chris Thrasher fef1e09542 Prefix library options with CSFML_ 2024-09-24 15:08:30 -06:00
Chris Thrasher 1b082ac255 Simplify shader creation functions 2024-09-24 15:08:17 -06:00
Chris Thrasher 7b583b1aac Use inheritance to remove This data member
It's reasonable to say that, for example, sfImage _is_ an sf::Image.
This "is-a" relationship is what inheritance does a very good job
modeling. By using inheritance to implement CSFML types in terms of
their SFML counterpart, we get code that is simpler and easier to
read. We also avoid some of the extra "dancing" required to construct
a CSFML type from an SFML type. This improves the encapsulation of
our CSFML implementation.
2024-09-24 11:05:19 -06:00
Miron Alexandru 8113ed23b9 Implement new audio functions 2024-09-23 14:26:43 -06:00
Miron Alexandru eb0f2974ab Implement new graphics, system and window functions 2024-09-23 11:16:06 -06:00
ZXShady 70397c6131 make sfRenderStates_default an extern const variable 2024-09-20 18:28:20 -05:00
Chris Thrasher 4ef89bb387 Implement new sf::Clock functions 2024-09-20 17:08:32 -05:00
Chris Thrasher fbe6e6193f Implement getGeometricCenter 2024-09-20 16:29:34 -05:00
Chris Thrasher 77b3035308 Manually inline sfShapeImpl 2024-09-20 15:55:10 -05:00
Chris Thrasher 17f7982215 Remove unnecessary constructors 2024-09-18 11:59:18 -04:00
ZXShady 5275e589f5 add missing asserts in Font.cpp 2024-09-18 11:32:03 -04:00
Chris Thrasher 5b910f8761 Remove all delete calls outside of _destroy functions 2024-09-18 11:30:12 -04:00
ZXShady ac477cf8b2 fix clang tidy warning about reserved identifier in WindowHandle.h 2024-09-18 11:24:01 -04:00
ZXShady 082a90ec4f use unique_ptr to handle memory of sfTexture 2024-09-18 10:52:21 -04:00
Chris Thrasher 3826091357 Assert against arguments which would invoke UB 2024-09-17 18:34:06 -04:00
Chris Thrasher d26c691458 Assert string arguments are not null
For these functions, providing a null pointer argument would result
in invoking undefined behavior.
2024-09-16 21:52:54 -04:00
Chris Thrasher 21d4571d5b Assert that filepath strings are not null 2024-09-16 13:39:12 -04:00
Chris Thrasher 9765e30e2f Assert that shader uniform names are not null 2024-09-12 17:17:31 -06:00
Chris Thrasher 2638160548 Use standard CMake variables for Doxygen paths 2024-09-12 12:35:12 -06:00
Chris Thrasher b229329d31 Simplify how Doxygen CMake variables are set 2024-09-12 12:35:12 -06:00
Chris Thrasher 7182877105 Improve phrasing in docs 2024-09-12 12:35:12 -06:00
Chris Thrasher 360268ea39 Improve const correctness 2024-09-12 10:08:46 -06:00