Skip to content

Commit 8e5d204

Browse files
committed
Add more doc comments
1 parent 3c52680 commit 8e5d204

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

include/AudioDevice.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class AudioDevice {
1515
* Initialize audio device and context.
1616
*
1717
* @param lateInit Whether or not to post-pone initializing the context.
18+
*
19+
* @throws raylib::RaylibException Throws if the AudioDevice failed to initialize.
1820
*/
1921
AudioDevice(bool lateInit = false) {
2022
if (!lateInit) {

include/AudioStream.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class AudioStream : public ::AudioStream {
2424

2525
/**
2626
* Init audio stream (to stream raw audio pcm data)
27+
*
28+
* @throws raylib::RaylibException Throws if the AudioStream failed to load.
2729
*/
2830
AudioStream(unsigned int SampleRate, unsigned int SampleSize, unsigned int Channels = 2) {
2931
if (!Load(SampleRate, SampleSize, Channels)) {

include/Font.hpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,28 @@ class Font : public ::Font {
3030
set(font);
3131
}
3232

33+
/**
34+
* Loads a Font from the given file.
35+
*
36+
* @param fileName The file name of the font to load.
37+
*
38+
* @throws raylib::RaylibException Throws if the given font failed to initialize.
39+
*/
3340
Font(const std::string& fileName) {
3441
if (!Load(fileName)) {
3542
throw RaylibException("Failed to load Font from file");
3643
}
3744
}
3845

46+
/**
47+
* Loads a Font from the given file, with generation parameters.
48+
*
49+
* @param fileName The file name of the font to load.
50+
*
51+
* @throws raylib::RaylibException Throws if the given font failed to initialize.
52+
*
53+
* @see ::LoadFontEx
54+
*/
3955
Font(const std::string& fileName, int fontSize, int* fontChars, int charCount) {
4056
if (!Load(fileName, fontSize, fontChars, charCount)) {
4157
throw RaylibException("Failed to load font from font with extras");
@@ -108,11 +124,30 @@ class Font : public ::Font {
108124
return *this;
109125
}
110126

127+
/**
128+
* Loads a font from a given file.
129+
*
130+
* @param fileName The filename of the font to load.
131+
*
132+
* @return True of false depending on if the font loaded successfully.
133+
*
134+
* @see ::LoadFont()
135+
*/
111136
bool Load(const std::string& fileName) {
112137
set(::LoadFont(fileName.c_str()));
113138
return baseSize > 0;
114139
}
115140

141+
/**
142+
* Loads a font from a given file with generation parameters.
143+
*
144+
* @param fileName The filename of the font to load.
145+
* @param fontSize The desired size of the font.
146+
*
147+
* @return True of false depending on if the font loaded successfully.
148+
*
149+
* @see ::LoadFontEx()
150+
*/
116151
bool Load(const std::string& fileName, int fontSize, int* fontChars, int charCount) {
117152
set(::LoadFontEx(fileName.c_str(), fontSize, fontChars, charCount));
118153
return baseSize > 0;

include/Image.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ class Image : public ::Image {
222222

223223
/**
224224
* Load image from file into CPU memory (RAM)
225+
*
226+
* @return Whether or not the image was loaded successfully.
227+
*
228+
* @see ::LoadImage()
225229
*/
226230
bool Load(const std::string& fileName) {
227231
set(::LoadImage(fileName.c_str()));
@@ -230,6 +234,10 @@ class Image : public ::Image {
230234

231235
/**
232236
* Load image from RAW file data.
237+
*
238+
* @return Whether or not the raw image data was loaded successfully.
239+
*
240+
* @see ::LoadImageRaw()
233241
*/
234242
bool Load(const std::string& fileName, int width, int height, int format, int headerSize) {
235243
set(::LoadImageRaw(fileName.c_str(), width, height, format, headerSize));
@@ -238,6 +246,10 @@ class Image : public ::Image {
238246

239247
/**
240248
* Load image sequence from file (frames appended to image.data).
249+
*
250+
* @return Whether or not the image animation was loaded successfully.
251+
*
252+
* @see ::LoadImageAnim()
241253
*/
242254
bool Load(const std::string& fileName, int* frames) {
243255
set(::LoadImageAnim(fileName.c_str(), frames));
@@ -246,6 +258,10 @@ class Image : public ::Image {
246258

247259
/**
248260
* Load image from memory buffer, fileType refers to extension: i.e. "png".
261+
*
262+
* @return Whether or not the image data was loaded successfully.
263+
*
264+
* @see ::LoadImageFromMemory()
249265
*/
250266
bool Load(
251267
const std::string& fileType,
@@ -259,6 +275,8 @@ class Image : public ::Image {
259275
* Load an image from the given file.
260276
*
261277
* @return True or false depending on whether or not the image was loaded from the texture.
278+
*
279+
* @see ::LoadImageFromTexture()
262280
*/
263281
bool Load(const ::Texture2D& texture) {
264282
set(::LoadImageFromTexture(texture));

0 commit comments

Comments
 (0)