diff --git a/include/AudioDevice.hpp b/include/AudioDevice.hpp index f8eb1fef..fa10e41e 100644 --- a/include/AudioDevice.hpp +++ b/include/AudioDevice.hpp @@ -36,7 +36,7 @@ class AudioDevice { * * @throws raylib::RaylibException Throws if the AudioDevice failed to initialize. */ - inline void Init() { + void Init() { ::InitAudioDevice(); if (!IsReady()) { throw RaylibException("Failed to initialize AudioDevice"); @@ -46,14 +46,14 @@ class AudioDevice { /** * Close the audio device and context. */ - inline void Close() { + void Close() { ::CloseAudioDevice(); } /** * Check if audio device has been initialized successfully. */ - inline bool IsReady() const { + bool IsReady() const { return ::IsAudioDeviceReady(); } @@ -62,7 +62,7 @@ class AudioDevice { * * @param volume The desired volume to set. */ - inline AudioDevice& SetVolume(float volume) { + AudioDevice& SetVolume(float volume) { ::SetMasterVolume(volume); return *this; } diff --git a/include/AudioStream.hpp b/include/AudioStream.hpp index a47a2a94..8edde003 100644 --- a/include/AudioStream.hpp +++ b/include/AudioStream.hpp @@ -81,7 +81,7 @@ class AudioStream : public ::AudioStream { /** * Update audio stream buffers with data */ - inline AudioStream& Update(const void *data, int samplesCount) { + AudioStream& Update(const void *data, int samplesCount) { ::UpdateAudioStream(*this, data, samplesCount); return *this; } @@ -89,21 +89,21 @@ class AudioStream : public ::AudioStream { /** * Unload audio stream and free memory */ - inline void Unload() { + void Unload() { ::UnloadAudioStream(*this); } /** * Check if any audio stream buffers requires refill */ - inline bool IsProcessed() const { + bool IsProcessed() const { return ::IsAudioStreamProcessed(*this); } /** * Play audio stream */ - inline AudioStream& Play() { + AudioStream& Play() { ::PlayAudioStream(*this); return *this; } @@ -111,7 +111,7 @@ class AudioStream : public ::AudioStream { /** * Pause audio stream */ - inline AudioStream& Pause() { + AudioStream& Pause() { ::PauseAudioStream(*this); return *this; } @@ -119,7 +119,7 @@ class AudioStream : public ::AudioStream { /** * Resume audio stream */ - inline AudioStream& Resume() { + AudioStream& Resume() { ::ResumeAudioStream(*this); return *this; } @@ -127,14 +127,14 @@ class AudioStream : public ::AudioStream { /** * Check if audio stream is playing */ - inline bool IsPlaying() const { + bool IsPlaying() const { return ::IsAudioStreamPlaying(*this); } /** * Stop audio stream */ - inline AudioStream& Stop() { + AudioStream& Stop() { ::StopAudioStream(*this); return *this; } @@ -142,7 +142,7 @@ class AudioStream : public ::AudioStream { /** * Set volume for audio stream (1.0 is max level) */ - inline AudioStream& SetVolume(float volume = 1.0f) { + AudioStream& SetVolume(float volume = 1.0f) { ::SetAudioStreamVolume(*this, volume); return *this; } @@ -150,7 +150,7 @@ class AudioStream : public ::AudioStream { /** * Set pitch for audio stream (1.0 is base level) */ - inline AudioStream& SetPitch(float pitch) { + AudioStream& SetPitch(float pitch) { ::SetAudioStreamPitch(*this, pitch); return *this; } @@ -158,7 +158,7 @@ class AudioStream : public ::AudioStream { /** * Set pan for audio stream (0.5 is centered) */ - inline AudioStream& SetPan(float pan = 0.5f) { + AudioStream& SetPan(float pan = 0.5f) { ::SetAudioStreamPitch(*this, pan); return *this; } @@ -166,28 +166,28 @@ class AudioStream : public ::AudioStream { /** * Default size for new audio streams */ - inline static void SetBufferSizeDefault(int size) { + static void SetBufferSizeDefault(int size) { ::SetAudioStreamBufferSizeDefault(size); } /** * Audio thread callback to request new data */ - inline void SetCallback(::AudioCallback callback) { + void SetCallback(::AudioCallback callback) { ::SetAudioStreamCallback(*this, callback); } /** * Attach audio stream processor to stream */ - inline void AttachProcessor(::AudioCallback processor) { + void AttachProcessor(::AudioCallback processor) { ::SetAudioStreamCallback(*this, processor); } /** * Detach audio stream processor from stream */ - inline void DetachProcessor(::AudioCallback processor) { + void DetachProcessor(::AudioCallback processor) { ::SetAudioStreamCallback(*this, processor); } diff --git a/include/AutomationEventList.hpp b/include/AutomationEventList.hpp index 63d6fe1f..77001989 100644 --- a/include/AutomationEventList.hpp +++ b/include/AutomationEventList.hpp @@ -81,39 +81,39 @@ class AutomationEventList : public ::AutomationEventList { /** * Update audio stream buffers with data */ - inline AutomationEventList& Unload() { + AutomationEventList& Unload() { ::UnloadAutomationEventList(this); return *this; } - inline bool IsReady() { + bool IsReady() { return events != nullptr; } - inline bool Export(const char* fileName) { + bool Export(const char* fileName) { return ::ExportAutomationEventList(*this, fileName); } - inline void Set() { + void Set() { ::SetAutomationEventList(this); } - inline void SetBaseFrame(int frame) { + void SetBaseFrame(int frame) { Set(); ::SetAutomationEventBaseFrame(frame); } - inline void StartRecording() { + void StartRecording() { Set(); ::StartAutomationEventRecording(); } - inline void StopRecording() { + void StopRecording() { Set(); ::StopAutomationEventRecording(); } - inline void Play(int index) { + void Play(int index) { if (index < 0 || index >= this->count) { return; } diff --git a/include/BoundingBox.hpp b/include/BoundingBox.hpp index 0f3aa615..86331c1c 100644 --- a/include/BoundingBox.hpp +++ b/include/BoundingBox.hpp @@ -38,35 +38,35 @@ class BoundingBox : public ::BoundingBox { /** * Draw a bounding box with wires */ - inline void Draw(::Color color = {255, 255, 255, 255}) const { + void Draw(::Color color = {255, 255, 255, 255}) const { ::DrawBoundingBox(*this, color); } /** * Detect collision between two boxes */ - inline bool CheckCollision(const ::BoundingBox& box2) const { + bool CheckCollision(const ::BoundingBox& box2) const { return CheckCollisionBoxes(*this, box2); } /** * Detect collision between box and sphere */ - inline bool CheckCollision(::Vector3 center, float radius) const { + bool CheckCollision(::Vector3 center, float radius) const { return CheckCollisionBoxSphere(*this, center, radius); } /** * Detect collision between ray and bounding box */ - inline bool CheckCollision(const ::Ray& ray) const { + bool CheckCollision(const ::Ray& ray) const { return GetRayCollisionBox(ray, *this).hit; } /** * Get collision information between ray and bounding box */ - inline RayCollision GetCollision(const ::Ray& ray) const { + RayCollision GetCollision(const ::Ray& ray) const { return GetRayCollisionBox(ray, *this); } diff --git a/include/Camera2D.hpp b/include/Camera2D.hpp index 13ad78a8..e47a92c5 100644 --- a/include/Camera2D.hpp +++ b/include/Camera2D.hpp @@ -19,12 +19,12 @@ class Camera2D : public ::Camera2D { Camera2D(::Vector2 offset, ::Vector2 target, float rotation = 0.0f, float zoom = 1.0f) : ::Camera2D{offset, target, rotation, zoom} {} - inline Camera2D& BeginMode() { + Camera2D& BeginMode() { ::BeginMode2D(*this); return *this; } - inline Camera2D& EndMode() { + Camera2D& EndMode() { ::EndMode2D(); return *this; } @@ -42,21 +42,21 @@ class Camera2D : public ::Camera2D { /** * Returns camera 2d transform matrix */ - inline Matrix GetMatrix() const { + Matrix GetMatrix() const { return ::GetCameraMatrix2D(*this); } /** * Returns the world space position for a 2d camera screen space position */ - inline Vector2 GetScreenToWorld(::Vector2 position) const { + Vector2 GetScreenToWorld(::Vector2 position) const { return ::GetScreenToWorld2D(position, *this); } /** * Returns the screen space position for a 3d world space position */ - inline Vector2 GetWorldToScreen(::Vector2 position) const { + Vector2 GetWorldToScreen(::Vector2 position) const { return ::GetWorldToScreen2D(position, *this); } diff --git a/include/Camera3D.hpp b/include/Camera3D.hpp index ac46082e..67cd19f6 100644 --- a/include/Camera3D.hpp +++ b/include/Camera3D.hpp @@ -62,14 +62,14 @@ class Camera3D : public ::Camera3D { /** * Get camera transform matrix (view matrix) */ - inline Matrix GetMatrix() const { + Matrix GetMatrix() const { return ::GetCameraMatrix(*this); } /** * Update camera position for selected mode */ - inline Camera3D& Update(int mode) { + Camera3D& Update(int mode) { ::UpdateCamera(this, mode); return *this; } @@ -77,7 +77,7 @@ class Camera3D : public ::Camera3D { /** * Update camera movement/rotation */ - inline Camera3D& Update(::Vector3 movement, ::Vector3 rotation, float zoom = 1.0f) { + Camera3D& Update(::Vector3 movement, ::Vector3 rotation, float zoom = 1.0f) { ::UpdateCameraPro(this, movement, rotation, zoom); return *this; } @@ -85,21 +85,21 @@ class Camera3D : public ::Camera3D { /** * Returns a ray trace from mouse position */ - inline Ray GetMouseRay(::Vector2 mousePosition) const { + Ray GetMouseRay(::Vector2 mousePosition) const { return ::GetMouseRay(mousePosition, *this); } /** * Returns the screen space position for a 3d world space position */ - inline Vector2 GetWorldToScreen(::Vector3 position) const { + Vector2 GetWorldToScreen(::Vector3 position) const { return ::GetWorldToScreen(position, *this); } /** * Draw a billboard texture. */ - inline void DrawBillboard( + void DrawBillboard( const ::Texture2D& texture, ::Vector3 center, float size, @@ -110,7 +110,7 @@ class Camera3D : public ::Camera3D { /** * Draw a billboard texture defined by source. */ - inline void DrawBillboard( + void DrawBillboard( const ::Texture2D& texture, ::Rectangle sourceRec, ::Vector3 center, diff --git a/include/Color.hpp b/include/Color.hpp index 09668357..edf6b200 100644 --- a/include/Color.hpp +++ b/include/Color.hpp @@ -65,11 +65,11 @@ class Color : public ::Color { return ::ColorToInt(*this); } - inline std::string ToString() const { + std::string ToString() const { return TextFormat("Color(%d, %d, %d, %d)", r, g, b, a); } - inline operator std::string() const { + operator std::string() const { return ToString(); } @@ -114,61 +114,61 @@ class Color : public ::Color { /** * Set background color (framebuffer clear color) */ - inline Color& ClearBackground() { + Color& ClearBackground() { ::ClearBackground(*this); return *this; } - inline void DrawPixel(int x, int y) const { + void DrawPixel(int x, int y) const { ::DrawPixel(x, y, *this); } /** * Draw a pixel */ - inline void DrawPixel(::Vector2 pos) const { + void DrawPixel(::Vector2 pos) const { ::DrawPixelV(pos, *this); } /** * Draw a line */ - inline void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY) const { + void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY) const { ::DrawLine(startPosX, startPosY, endPosX, endPosY, *this); } /** * Draw a line using Vector points */ - inline void DrawLine(::Vector2 startPos, ::Vector2 endPos) const { + void DrawLine(::Vector2 startPos, ::Vector2 endPos) const { ::DrawLineV(startPos, endPos, *this); } /** * Draw a line using Vector points, with a given thickness */ - inline void DrawLine(::Vector2 startPos, ::Vector2 endPos, float thick) const { + void DrawLine(::Vector2 startPos, ::Vector2 endPos, float thick) const { ::DrawLineEx(startPos, endPos, thick, *this); } - inline void DrawLineBezier(::Vector2 startPos, ::Vector2 endPos, float thick = 1.0f) const { + void DrawLineBezier(::Vector2 startPos, ::Vector2 endPos, float thick = 1.0f) const { ::DrawLineBezier(startPos, endPos, thick, *this); } - inline void DrawLineStrip(::Vector2 *points, int numPoints) const { + void DrawLineStrip(::Vector2 *points, int numPoints) const { ::DrawLineStrip(points, numPoints, *this); } - inline void DrawText(const std::string& text, int posX = 0, int posY = 0, int fontSize = 10.0f) const { + void DrawText(const std::string& text, int posX = 0, int posY = 0, int fontSize = 10.0f) const { ::DrawText(text.c_str(), posX, posY, fontSize, *this); } - inline void DrawText(const ::Font& font, const std::string& text, ::Vector2 position, + void DrawText(const ::Font& font, const std::string& text, ::Vector2 position, float fontSize, float spacing) const { ::DrawTextEx(font, text.c_str(), position, fontSize, spacing, *this); } - inline void DrawText( + void DrawText( const ::Font& font, const std::string& text, ::Vector2 position, @@ -179,48 +179,48 @@ class Color : public ::Color { ::DrawTextPro(font, text.c_str(), position, origin, rotation, fontSize, spacing, *this); } - inline void DrawRectangle(int posX, int posY, int width, int height) const { + void DrawRectangle(int posX, int posY, int width, int height) const { ::DrawRectangle(posX, posY, width, height, *this); } - inline void DrawRectangle(::Vector2 position, ::Vector2 size) const { + void DrawRectangle(::Vector2 position, ::Vector2 size) const { ::DrawRectangleV(position, size, *this); } - inline void DrawRectangle(::Rectangle rec) const { + void DrawRectangle(::Rectangle rec) const { ::DrawRectangleRec(rec, *this); } - inline void DrawRectangle(::Rectangle rec, ::Vector2 origin, float rotation) const { + void DrawRectangle(::Rectangle rec, ::Vector2 origin, float rotation) const { ::DrawRectanglePro(rec, origin, rotation, *this); } - inline void DrawRectangleLines(int posX, int posY, int width, int height) const { + void DrawRectangleLines(int posX, int posY, int width, int height) const { ::DrawRectangleLines(posX, posY, width, height, *this); } - inline void DrawRectangleLines(::Rectangle rec, float lineThick) const { + void DrawRectangleLines(::Rectangle rec, float lineThick) const { ::DrawRectangleLinesEx(rec, lineThick, *this); } /** * Get color multiplied with another color */ - inline Color Tint(::Color tint) { + Color Tint(::Color tint) { return ::ColorTint(*this, tint); } /** * Get color with brightness correction, brightness factor goes from -1.0f to 1.0f */ - inline Color Brightness(float factor) { + Color Brightness(float factor) { return ::ColorBrightness(*this, factor); } /** * Get color with contrast correction, contrast values between -1.0f and 1.0f */ - inline Color Contrast(float contrast) { + Color Contrast(float contrast) { return ::ColorContrast(*this, contrast); } @@ -238,32 +238,32 @@ class Color : public ::Color { return ::ColorAlphaBlend(dst, *this, tint); } - inline static Color LightGray() { return LIGHTGRAY; } - inline static Color Gray() { return GRAY; } - inline static Color DarkGray() { return DARKGRAY; } - inline static Color Yellow() { return YELLOW; } - inline static Color Gold() { return GOLD; } - inline static Color Orange() { return ORANGE; } - inline static Color Pink() { return PINK; } - inline static Color Red() { return RED; } - inline static Color Maroon() { return MAROON; } - inline static Color Green() { return GREEN; } - inline static Color Lime() { return LIME; } - inline static Color DarkGreen() { return DARKGREEN; } - inline static Color SkyBlue() { return SKYBLUE; } - inline static Color Blue() { return BLUE; } - inline static Color DarkBlue() { return DARKBLUE; } - inline static Color Purple() { return PURPLE; } - inline static Color Violet() { return VIOLET; } - inline static Color DarkPurple() { return DARKPURPLE; } - inline static Color Beige() { return BEIGE; } - inline static Color Brown() { return BROWN; } - inline static Color DarkBrown() { return DARKBROWN; } - inline static Color White() { return WHITE; } - inline static Color Black() { return BLACK; } - inline static Color Blank() { return BLANK; } - inline static Color Magenta() { return MAGENTA; } - inline static Color RayWhite() { return RAYWHITE; } + static Color LightGray() { return LIGHTGRAY; } + static Color Gray() { return GRAY; } + static Color DarkGray() { return DARKGRAY; } + static Color Yellow() { return YELLOW; } + static Color Gold() { return GOLD; } + static Color Orange() { return ORANGE; } + static Color Pink() { return PINK; } + static Color Red() { return RED; } + static Color Maroon() { return MAROON; } + static Color Green() { return GREEN; } + static Color Lime() { return LIME; } + static Color DarkGreen() { return DARKGREEN; } + static Color SkyBlue() { return SKYBLUE; } + static Color Blue() { return BLUE; } + static Color DarkBlue() { return DARKBLUE; } + static Color Purple() { return PURPLE; } + static Color Violet() { return VIOLET; } + static Color DarkPurple() { return DARKPURPLE; } + static Color Beige() { return BEIGE; } + static Color Brown() { return BROWN; } + static Color DarkBrown() { return DARKBROWN; } + static Color White() { return WHITE; } + static Color Black() { return BLACK; } + static Color Blank() { return BLANK; } + static Color Magenta() { return MAGENTA; } + static Color RayWhite() { return RAYWHITE; } protected: void set(const ::Color& color) { diff --git a/include/Font.hpp b/include/Font.hpp index be97d718..7ac33dd0 100644 --- a/include/Font.hpp +++ b/include/Font.hpp @@ -117,14 +117,14 @@ class Font : public ::Font { /** * Get the texture atlas containing the glyphs. */ - inline TextureUnmanaged GetTexture() { + TextureUnmanaged GetTexture() { return texture; } /** * Set the texture atlas containing the glyphs. */ - inline void SetTexture(const ::Texture& newTexture) { + void SetTexture(const ::Texture& newTexture) { texture = newTexture; } @@ -213,7 +213,7 @@ class Font : public ::Font { /** * Draw text using font and additional parameters. */ - inline void DrawText(const std::string& text, ::Vector2 position, float fontSize, + void DrawText(const std::string& text, ::Vector2 position, float fontSize, float spacing, ::Color tint = WHITE) const { ::DrawTextEx(*this, text.c_str(), position, fontSize, spacing, tint); } @@ -221,14 +221,14 @@ class Font : public ::Font { /** * Draw text using font and additional parameters. */ - inline void DrawText(const std::string& text, int posX, int posY, float fontSize, + void DrawText(const std::string& text, int posX, int posY, float fontSize, float spacing, ::Color tint = WHITE) const { ::DrawTextEx(*this, text.c_str(), { static_cast(posX), static_cast(posY) }, fontSize, spacing, tint); } - inline void DrawText( + void DrawText( const std::string& text, ::Vector2 position, ::Vector2 origin, @@ -245,7 +245,7 @@ class Font : public ::Font { /** * Draw one character (codepoint) */ - inline void DrawText(int codepoint, + void DrawText(int codepoint, ::Vector2 position, float fontSize, ::Color tint = { 255, 255, 255, 255 }) const { @@ -255,7 +255,7 @@ class Font : public ::Font { /** * Draw multiple character (codepoint) */ - inline void DrawText(const int *codepoints, + void DrawText(const int *codepoints, int count, ::Vector2 position, float fontSize, float spacing, ::Color tint = { 255, 255, 255, 255 }) const { @@ -268,21 +268,21 @@ class Font : public ::Font { /** * Measure string size for Font */ - inline Vector2 MeasureText(const std::string& text, float fontSize, float spacing) const { + Vector2 MeasureText(const std::string& text, float fontSize, float spacing) const { return ::MeasureTextEx(*this, text.c_str(), fontSize, spacing); } /** * Get index position for a unicode character on font */ - inline int GetGlyphIndex(int character) const { + int GetGlyphIndex(int character) const { return ::GetGlyphIndex(*this, character); } /** * Create an image from text (custom sprite font) */ - inline ::Image ImageText(const std::string& text, float fontSize, + ::Image ImageText(const std::string& text, float fontSize, float spacing, ::Color tint) const { return ::ImageTextEx(*this, text.c_str(), fontSize, spacing, tint); } diff --git a/include/Gamepad.hpp b/include/Gamepad.hpp index bffa047e..17a8261a 100644 --- a/include/Gamepad.hpp +++ b/include/Gamepad.hpp @@ -34,14 +34,14 @@ class Gamepad { /** * Detect if a gamepad is available */ - inline bool IsAvailable() const { + bool IsAvailable() const { return ::IsGamepadAvailable(number); } /** * Detect if a gamepad is available */ - static inline bool IsAvailable(int number) { + static bool IsAvailable(int number) { return ::IsGamepadAvailable(number); } @@ -62,58 +62,58 @@ class Gamepad { /** * Detect if a gamepad button has been pressed once */ - inline bool IsButtonPressed(int button) const { + bool IsButtonPressed(int button) const { return ::IsGamepadButtonPressed(number, button); } /** * Detect if a gamepad button is being pressed */ - inline bool IsButtonDown(int button) const { + bool IsButtonDown(int button) const { return ::IsGamepadButtonDown(number, button); } /** * Detect if a gamepad button has been released once */ - inline bool IsButtonReleased(int button) const { + bool IsButtonReleased(int button) const { return ::IsGamepadButtonReleased(number, button); } /** * Detect if a gamepad button is NOT being pressed */ - inline bool IsButtonUp(int button) const { + bool IsButtonUp(int button) const { return ::IsGamepadButtonUp(number, button); } /** * Get the last gamepad button pressed */ - inline int GetButtonPressed() const { + int GetButtonPressed() const { return ::GetGamepadButtonPressed(); } /** * Return gamepad axis count for a gamepad */ - inline int GetAxisCount() const { + int GetAxisCount() const { return ::GetGamepadAxisCount(number); } /** * Return axis movement value for a gamepad axis */ - inline float GetAxisMovement(int axis) const { + float GetAxisMovement(int axis) const { return ::GetGamepadAxisMovement(number, axis); } - inline int SetMappings(const std::string& mappings) { + int SetMappings(const std::string& mappings) { return SetGamepadMappings(mappings.c_str()); } protected: - inline void set(int gamepadNumber) { + void set(int gamepadNumber) { number = gamepadNumber; } }; diff --git a/include/Image.hpp b/include/Image.hpp index 0fc4002a..a000c730 100644 --- a/include/Image.hpp +++ b/include/Image.hpp @@ -280,7 +280,7 @@ class Image : public ::Image { /** * Unload image from CPU memory (RAM) */ - inline void Unload() { + void Unload() { if (data != nullptr) { ::UnloadImage(*this); data = nullptr; @@ -292,7 +292,7 @@ class Image : public ::Image { * * @throws raylib::RaylibException Thrown if the image failed to load from the file. */ - inline void Export(const std::string& fileName) const { + void Export(const std::string& fileName) const { if (!::ExportImage(*this, fileName.c_str())) { throw RaylibException(TextFormat("Failed to export Image to file: %s", fileName.c_str())); } @@ -301,7 +301,7 @@ class Image : public ::Image { /** * Export image to memory buffer */ - inline unsigned char* ExportToMemory(const char *fileType, int *fileSize) { + unsigned char* ExportToMemory(const char *fileType, int *fileSize) { return ::ExportImageToMemory(*this, fileType, fileSize); } @@ -310,7 +310,7 @@ class Image : public ::Image { * * @throws raylib::RaylibException Thrown if the image failed to load from the file. */ - inline void ExportAsCode(const std::string& fileName) const { + void ExportAsCode(const std::string& fileName) const { if (!::ExportImageAsCode(*this, fileName.c_str())) { throw RaylibException(TextFormat("Failed to export Image code to file: %s", fileName.c_str())); } @@ -325,28 +325,28 @@ class Image : public ::Image { /** * Retrieve the width and height of the image. */ - inline ::Vector2 GetSize() const { + ::Vector2 GetSize() const { return {static_cast(width), static_cast(height)}; } /** * Create an image duplicate (useful for transformations) */ - inline ::Image Copy() const { + ::Image Copy() const { return ::ImageCopy(*this); } /** * Create an image from another image piece */ - inline ::Image FromImage(::Rectangle rec) const { + ::Image FromImage(::Rectangle rec) const { return ::ImageFromImage(*this, rec); } /** * Convert image data to desired format */ - inline Image& Format(int newFormat) { + Image& Format(int newFormat) { ::ImageFormat(this, newFormat); return *this; } @@ -354,7 +354,7 @@ class Image : public ::Image { /** * Convert image to POT (power-of-two) */ - inline Image& ToPOT(::Color fillColor) { + Image& ToPOT(::Color fillColor) { ::ImageToPOT(this, fillColor); return *this; } @@ -362,7 +362,7 @@ class Image : public ::Image { /** * Crop an image to area defined by a rectangle */ - inline Image& Crop(::Rectangle crop) { + Image& Crop(::Rectangle crop) { ::ImageCrop(this, crop); return *this; } @@ -370,7 +370,7 @@ class Image : public ::Image { /** * Crop image depending on alpha value */ - inline Image& AlphaCrop(float threshold) { + Image& AlphaCrop(float threshold) { ::ImageAlphaCrop(this, threshold); return *this; } @@ -378,7 +378,7 @@ class Image : public ::Image { /** * Clear alpha channel to desired color */ - inline Image& AlphaClear(::Color color, float threshold) { + Image& AlphaClear(::Color color, float threshold) { ::ImageAlphaClear(this, color, threshold); return *this; } @@ -386,7 +386,7 @@ class Image : public ::Image { /** * Apply alpha mask to image */ - inline Image& AlphaMask(const ::Image& alphaMask) { + Image& AlphaMask(const ::Image& alphaMask) { ::ImageAlphaMask(this, alphaMask); return *this; } @@ -394,7 +394,7 @@ class Image : public ::Image { /** * Premultiply alpha channel */ - inline Image& AlphaPremultiply() { + Image& AlphaPremultiply() { ::ImageAlphaPremultiply(this); return *this; } @@ -402,21 +402,21 @@ class Image : public ::Image { /** * Crop an image to a new given width and height. */ - inline Image& Crop(int newWidth, int newHeight) { + Image& Crop(int newWidth, int newHeight) { return Crop(0, 0, newWidth, newHeight); } /** * Crop an image to a new given width and height based on a vector. */ - inline Image& Crop(::Vector2 size) { + Image& Crop(::Vector2 size) { return Crop(0, 0, static_cast(size.x), static_cast(size.y)); } /** * Crop an image to area defined by a rectangle */ - inline Image& Crop(int offsetX, int offsetY, int newWidth, int newHeight) { + Image& Crop(int offsetX, int offsetY, int newWidth, int newHeight) { ::Rectangle rect{ static_cast(offsetX), static_cast(offsetY), @@ -430,7 +430,7 @@ class Image : public ::Image { /** * Resize and image to new size */ - inline Image& Resize(int newWidth, int newHeight) { + Image& Resize(int newWidth, int newHeight) { ::ImageResize(this, newWidth, newHeight); return *this; } @@ -438,7 +438,7 @@ class Image : public ::Image { /** * Resize and image to new size using Nearest-Neighbor scaling algorithm */ - inline Image& ResizeNN(int newWidth, int newHeight) { + Image& ResizeNN(int newWidth, int newHeight) { ::ImageResizeNN(this, newWidth, newHeight); return *this; } @@ -446,7 +446,7 @@ class Image : public ::Image { /** * Resize canvas and fill with color */ - inline Image& ResizeCanvas(int newWidth, int newHeight, int offsetX = 0, int offsetY = 0, + Image& ResizeCanvas(int newWidth, int newHeight, int offsetX = 0, int offsetY = 0, ::Color color = {255, 255, 255, 255}) { ::ImageResizeCanvas(this, newWidth, newHeight, offsetX, offsetY, color); return *this; @@ -455,7 +455,7 @@ class Image : public ::Image { /** * Generate all mipmap levels for a provided image */ - inline Image& Mipmaps() { + Image& Mipmaps() { ::ImageMipmaps(this); return *this; } @@ -463,7 +463,7 @@ class Image : public ::Image { /** * Dither image data to 16bpp or lower (Floyd-Steinberg dithering) */ - inline Image& Dither(int rBpp, int gBpp, int bBpp, int aBpp) { + Image& Dither(int rBpp, int gBpp, int bBpp, int aBpp) { ::ImageDither(this, rBpp, gBpp, bBpp, aBpp); return *this; } @@ -471,7 +471,7 @@ class Image : public ::Image { /** * Flip image vertically */ - inline Image& FlipVertical() { + Image& FlipVertical() { ::ImageFlipVertical(this); return *this; } @@ -479,7 +479,7 @@ class Image : public ::Image { /** * Flip image horizontally */ - inline Image& FlipHorizontal() { + Image& FlipHorizontal() { ::ImageFlipHorizontal(this); return *this; } @@ -487,7 +487,7 @@ class Image : public ::Image { /** * Rotate image by input angle in degrees (-359 to 359) */ - inline Image& Rotate(int degrees) { + Image& Rotate(int degrees) { ::ImageRotate(this, degrees); return *this; } @@ -495,7 +495,7 @@ class Image : public ::Image { /** * Rotate image clockwise 90deg */ - inline Image& RotateCW() { + Image& RotateCW() { ::ImageRotateCW(this); return *this; } @@ -503,7 +503,7 @@ class Image : public ::Image { /** * Rotate image counter-clockwise 90deg */ - inline Image& RotateCCW() { + Image& RotateCCW() { ::ImageRotateCCW(this); return *this; } @@ -511,7 +511,7 @@ class Image : public ::Image { /** * Modify image color: tint */ - inline Image& ColorTint(::Color color = {255, 255, 255, 255}) { + Image& ColorTint(::Color color = {255, 255, 255, 255}) { ::ImageColorTint(this, color); return *this; } @@ -519,7 +519,7 @@ class Image : public ::Image { /** * Modify image color: invert */ - inline Image& ColorInvert() { + Image& ColorInvert() { ::ImageColorInvert(this); return *this; } @@ -527,7 +527,7 @@ class Image : public ::Image { /** * Modify image color: grayscale */ - inline Image& ColorGrayscale() { + Image& ColorGrayscale() { ::ImageColorGrayscale(this); return *this; } @@ -537,7 +537,7 @@ class Image : public ::Image { * * @param contrast Contrast values between -100 and 100 */ - inline Image& ColorContrast(float contrast) { + Image& ColorContrast(float contrast) { ::ImageColorContrast(this, contrast); return *this; } @@ -547,7 +547,7 @@ class Image : public ::Image { * * @param brightness Brightness values between -255 and 255 */ - inline Image& ColorBrightness(int brightness) { + Image& ColorBrightness(int brightness) { ::ImageColorBrightness(this, brightness); return *this; } @@ -555,7 +555,7 @@ class Image : public ::Image { /** * Modify image color: replace color */ - inline Image& ColorReplace(::Color color, ::Color replace) { + Image& ColorReplace(::Color color, ::Color replace) { ::ImageColorReplace(this, color, replace); return *this; } @@ -565,28 +565,28 @@ class Image : public ::Image { * * @param threshold Threshold is defined as a percentatge: 0.0f -> 1.0f */ - inline Rectangle GetAlphaBorder(float threshold) const { + Rectangle GetAlphaBorder(float threshold) const { return ::GetImageAlphaBorder(*this, threshold); } /** * Get image pixel color at (x, y) position */ - inline raylib::Color GetColor(int x = 0, int y = 0) const { + raylib::Color GetColor(int x = 0, int y = 0) const { return ::GetImageColor(*this, x, y); } /** * Get image pixel color at vector position */ - inline raylib::Color GetColor(::Vector2 position) const { + raylib::Color GetColor(::Vector2 position) const { return ::GetImageColor(*this, static_cast(position.x), static_cast(position.y)); } /** * Clear image background with given color */ - inline Image& ClearBackground(::Color color = {0, 0, 0, 255}) { + Image& ClearBackground(::Color color = {0, 0, 0, 255}) { ::ImageClearBackground(this, color); return *this; } @@ -594,58 +594,58 @@ class Image : public ::Image { /** * Draw pixel within an image */ - inline void DrawPixel(int posX, int posY, ::Color color = {255, 255, 255, 255}) { + void DrawPixel(int posX, int posY, ::Color color = {255, 255, 255, 255}) { ::ImageDrawPixel(this, posX, posY, color); } - inline void DrawPixel(::Vector2 position, ::Color color = {255, 255, 255, 255}) { + void DrawPixel(::Vector2 position, ::Color color = {255, 255, 255, 255}) { ::ImageDrawPixelV(this, position, color); } - inline void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, + void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, ::Color color = {255, 255, 255, 255}) { ::ImageDrawLine(this, startPosX, startPosY, endPosX, endPosY, color); } - inline void DrawLine(::Vector2 start, ::Vector2 end, ::Color color = {255, 255, 255, 255}) { + void DrawLine(::Vector2 start, ::Vector2 end, ::Color color = {255, 255, 255, 255}) { ::ImageDrawLineV(this, start, end, color); } - inline void DrawCircle(int centerX, int centerY, int radius, + void DrawCircle(int centerX, int centerY, int radius, ::Color color = {255, 255, 255, 255}) { ::ImageDrawCircle(this, centerX, centerY, radius, color); } - inline void DrawCircle(::Vector2 center, int radius, + void DrawCircle(::Vector2 center, int radius, ::Color color = {255, 255, 255, 255}) { ::ImageDrawCircleV(this, center, radius, color); } - inline void DrawRectangle(int posX, int posY, int width, int height, + void DrawRectangle(int posX, int posY, int width, int height, ::Color color = {255, 255, 255, 255}) { ::ImageDrawRectangle(this, posX, posY, width, height, color); } - inline void DrawRectangle(Vector2 position, Vector2 size, + void DrawRectangle(Vector2 position, Vector2 size, ::Color color = {255, 255, 255, 255}) { ::ImageDrawRectangleV(this, position, size, color); } - inline void DrawRectangle(::Rectangle rec, ::Color color = {255, 255, 255, 255}) { + void DrawRectangle(::Rectangle rec, ::Color color = {255, 255, 255, 255}) { ::ImageDrawRectangleRec(this, rec, color); } - inline void DrawRectangleLines(::Rectangle rec, int thick = 1, + void DrawRectangleLines(::Rectangle rec, int thick = 1, ::Color color = {255, 255, 255, 255}) { ::ImageDrawRectangleLines(this, rec, thick, color); } - inline void Draw(const ::Image& src, ::Rectangle srcRec, ::Rectangle dstRec, + void Draw(const ::Image& src, ::Rectangle srcRec, ::Rectangle dstRec, ::Color tint = {255, 255, 255, 255}) { ::ImageDraw(this, src, srcRec, dstRec, tint); } - inline void DrawText(const std::string& text, ::Vector2 position, int fontSize, + void DrawText(const std::string& text, ::Vector2 position, int fontSize, ::Color color = {255, 255, 255, 255}) { ::ImageDrawText(this, text.c_str(), @@ -655,12 +655,12 @@ class Image : public ::Image { color); } - inline void DrawText(const std::string& text, int x, int y, int fontSize, + void DrawText(const std::string& text, int x, int y, int fontSize, ::Color color = {255, 255, 255, 255}) { ::ImageDrawText(this, text.c_str(), x, y, fontSize, color); } - inline void DrawText(const ::Font& font, const std::string& text, ::Vector2 position, + void DrawText(const ::Font& font, const std::string& text, ::Vector2 position, float fontSize, float spacing, ::Color tint = {255, 255, 255, 255}) { ::ImageDrawTextEx(this, font, text.c_str(), position, fontSize, spacing, tint); } @@ -668,35 +668,35 @@ class Image : public ::Image { /** * Load color data from image as a Color array (RGBA - 32bit) */ - inline ::Color* LoadColors() const { + ::Color* LoadColors() const { return ::LoadImageColors(*this); } /** * Load colors palette from image as a Color array (RGBA - 32bit) */ - inline ::Color* LoadPalette(int maxPaletteSize, int *colorsCount) const { + ::Color* LoadPalette(int maxPaletteSize, int *colorsCount) const { return ::LoadImagePalette(*this, maxPaletteSize, colorsCount); } /** * Unload color data loaded with LoadImageColors() */ - inline void UnloadColors(::Color* colors) const { + void UnloadColors(::Color* colors) const { ::UnloadImageColors(colors); } /** * Unload colors palette loaded with LoadImagePalette() */ - inline void UnloadPalette(::Color* colors) const { + void UnloadPalette(::Color* colors) const { ::UnloadImagePalette(colors); } /** * Load texture from image data. */ - inline ::Texture2D LoadTexture() const { + ::Texture2D LoadTexture() const { return ::LoadTextureFromImage(*this); } @@ -705,7 +705,7 @@ class Image : public ::Image { * * @see LoadTexture() */ - inline operator ::Texture2D() { + operator ::Texture2D() { return LoadTexture(); } @@ -721,7 +721,7 @@ class Image : public ::Image { * * @return The pixel data size of the image. */ - inline int GetPixelDataSize() const { + int GetPixelDataSize() const { return ::GetPixelDataSize(width, height, format); } @@ -730,7 +730,7 @@ class Image : public ::Image { * * @return True or false depending on whether the Image has been loaded. */ - inline bool IsReady() const { + bool IsReady() const { return ::IsImageReady(*this); } diff --git a/include/Material.hpp b/include/Material.hpp index c9771061..cd15ceca 100644 --- a/include/Material.hpp +++ b/include/Material.hpp @@ -80,7 +80,7 @@ class Material : public ::Material { /** * Unload material from memory */ - inline void Unload() { + void Unload() { if (maps != nullptr) { ::UnloadMaterial(*this); maps = nullptr; @@ -90,7 +90,7 @@ class Material : public ::Material { /** * Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) */ - inline Material& SetTexture(int mapType, const ::Texture2D& texture) { + Material& SetTexture(int mapType, const ::Texture2D& texture) { ::SetMaterialTexture(this, mapType, texture); return *this; } @@ -98,21 +98,21 @@ class Material : public ::Material { /** * Draw a 3d mesh with material and transform */ - inline void DrawMesh(const ::Mesh& mesh, ::Matrix transform) const { + void DrawMesh(const ::Mesh& mesh, ::Matrix transform) const { ::DrawMesh(mesh, *this, transform); } /** * Draw multiple mesh instances with material and different transforms */ - inline void DrawMesh(const ::Mesh& mesh, ::Matrix* transforms, int instances) const { + void DrawMesh(const ::Mesh& mesh, ::Matrix* transforms, int instances) const { ::DrawMeshInstanced(mesh, *this, transforms, instances); } /** * Check if material is ready */ - inline bool IsReady() const { + bool IsReady() const { return ::IsMaterialReady(*this); } diff --git a/include/Matrix.hpp b/include/Matrix.hpp index a3376485..ff8ad7c8 100644 --- a/include/Matrix.hpp +++ b/include/Matrix.hpp @@ -90,18 +90,18 @@ class Matrix : public ::Matrix { /** * Returns the trace of the matrix (sum of the values along the diagonal) */ - inline float Trace() const { + float Trace() const { return ::MatrixTrace(*this); } /** * Transposes provided matrix */ - inline Matrix Transpose() const { + Matrix Transpose() const { return ::MatrixTranspose(*this); } - inline Matrix Invert() const { + Matrix Invert() const { return ::MatrixInvert(*this); } @@ -179,7 +179,7 @@ class Matrix : public ::Matrix { return ::MatrixLookAt(eye, target, up); } - inline float16 ToFloatV() const { + float16 ToFloatV() const { return ::MatrixToFloatV(*this); } @@ -190,16 +190,16 @@ class Matrix : public ::Matrix { /** * Set shader uniform value (matrix 4x4) */ - inline Matrix& SetShaderValue(const ::Shader& shader, int uniformLoc) { + Matrix& SetShaderValue(const ::Shader& shader, int uniformLoc) { ::SetShaderValueMatrix(shader, uniformLoc, *this); return *this; } - inline static Matrix GetCamera(const ::Camera& camera) { + static Matrix GetCamera(const ::Camera& camera) { return ::GetCameraMatrix(camera); } - inline static Matrix GetCamera(const ::Camera2D& camera) { + static Matrix GetCamera(const ::Camera2D& camera) { return ::GetCameraMatrix2D(camera); } diff --git a/include/Mesh.hpp b/include/Mesh.hpp index e45ec225..7b6d6cbf 100644 --- a/include/Mesh.hpp +++ b/include/Mesh.hpp @@ -184,28 +184,28 @@ class Mesh : public ::Mesh { /** * Upload mesh vertex data to GPU (VRAM) */ - inline void Upload(bool dynamic = false) { + void Upload(bool dynamic = false) { ::UploadMesh(this, dynamic); } /** * Upload mesh vertex data to GPU (VRAM) */ - inline void UpdateBuffer(int index, void *data, int dataSize, int offset = 0) { + void UpdateBuffer(int index, void *data, int dataSize, int offset = 0) { ::UpdateMeshBuffer(*this, index, data, dataSize, offset); } /** * Draw a 3d mesh with material and transform */ - inline void Draw(const ::Material& material, const ::Matrix& transform) const { + void Draw(const ::Material& material, const ::Matrix& transform) const { ::DrawMesh(*this, material, transform); } /** * Draw multiple mesh instances with material and different transforms */ - inline void Draw(const ::Material& material, ::Matrix* transforms, int instances) const { + void Draw(const ::Material& material, ::Matrix* transforms, int instances) const { ::DrawMeshInstanced(*this, material, transforms, instances); } @@ -214,7 +214,7 @@ class Mesh : public ::Mesh { * * @throws raylib::RaylibException Throws if failed to export the Mesh. */ - inline void Export(const std::string& fileName) { + void Export(const std::string& fileName) { if (!::ExportMesh(*this, fileName.c_str())) { throw new RaylibException("Failed to export the Mesh"); } @@ -223,7 +223,7 @@ class Mesh : public ::Mesh { /** * Unload mesh from memory (RAM and/or VRAM) */ - inline void Unload() { + void Unload() { if (vboId != nullptr) { ::UnloadMesh(*this); vboId = nullptr; @@ -233,7 +233,7 @@ class Mesh : public ::Mesh { /** * Compute mesh bounding box limits */ - inline raylib::BoundingBox BoundingBox() const { + raylib::BoundingBox BoundingBox() const { return ::GetMeshBoundingBox(*this); } @@ -247,7 +247,7 @@ class Mesh : public ::Mesh { /** * Compute mesh tangents */ - inline Mesh& GenTangents() { + Mesh& GenTangents() { ::GenMeshTangents(this); return *this; } @@ -255,7 +255,7 @@ class Mesh : public ::Mesh { /** * Load model from generated mesh */ - inline raylib::Model LoadModelFrom() const { + raylib::Model LoadModelFrom() const { return ::LoadModelFromMesh(*this); } diff --git a/include/Model.hpp b/include/Model.hpp index c0175baf..a2e1cf97 100644 --- a/include/Model.hpp +++ b/include/Model.hpp @@ -102,7 +102,7 @@ class Model : public ::Model { /** * Unload model (including meshes) from memory (RAM and/or VRAM) */ - inline void Unload() { + void Unload() { if (meshes != nullptr || materials != nullptr) { ::UnloadModel(*this); meshes = nullptr; @@ -113,7 +113,7 @@ class Model : public ::Model { /** * Set material for a mesh */ - inline Model& SetMeshMaterial(int meshId, int materialId) { + Model& SetMeshMaterial(int meshId, int materialId) { ::SetModelMeshMaterial(this, meshId, materialId); return *this; } @@ -121,7 +121,7 @@ class Model : public ::Model { /** * Update model animation pose */ - inline Model& UpdateAnimation(const ::ModelAnimation& anim, int frame) { + Model& UpdateAnimation(const ::ModelAnimation& anim, int frame) { ::UpdateModelAnimation(*this, anim, frame); return *this; } @@ -129,14 +129,14 @@ class Model : public ::Model { /** * Check model animation skeleton match */ - inline bool IsModelAnimationValid(const ::ModelAnimation& anim) const { + bool IsModelAnimationValid(const ::ModelAnimation& anim) const { return ::IsModelAnimationValid(*this, anim); } /** * Draw a model (with texture if set) */ - inline void Draw(::Vector3 position, + void Draw(::Vector3 position, float scale = 1.0f, ::Color tint = {255, 255, 255, 255}) const { ::DrawModel(*this, position, scale, tint); @@ -145,7 +145,7 @@ class Model : public ::Model { /** * Draw a model with extended parameters */ - inline void Draw( + void Draw( ::Vector3 position, ::Vector3 rotationAxis, float rotationAngle = 0.0f, @@ -157,7 +157,7 @@ class Model : public ::Model { /** * Draw a model wires (with texture if set) */ - inline void DrawWires(::Vector3 position, + void DrawWires(::Vector3 position, float scale = 1.0f, ::Color tint = {255, 255, 255, 255}) const { ::DrawModelWires(*this, position, scale, tint); @@ -166,7 +166,7 @@ class Model : public ::Model { /** * Draw a model wires (with texture if set) with extended parameters */ - inline void DrawWires( + void DrawWires( ::Vector3 position, ::Vector3 rotationAxis, float rotationAngle = 0.0f, @@ -178,7 +178,7 @@ class Model : public ::Model { /** * Compute model bounding box limits (considers all meshes) */ - inline BoundingBox GetBoundingBox() const { + BoundingBox GetBoundingBox() const { return ::GetModelBoundingBox(*this); } diff --git a/include/ModelAnimation.hpp b/include/ModelAnimation.hpp index ccc5a052..9440df5a 100644 --- a/include/ModelAnimation.hpp +++ b/include/ModelAnimation.hpp @@ -77,14 +77,14 @@ class ModelAnimation : public ::ModelAnimation { /** * Unload animation data */ - inline void Unload() { + void Unload() { ::UnloadModelAnimation(*this); } /** * Update model animation pose */ - inline ModelAnimation& Update(const ::Model& model, int frame) { + ModelAnimation& Update(const ::Model& model, int frame) { ::UpdateModelAnimation(model, *this, frame); return *this; } @@ -92,7 +92,7 @@ class ModelAnimation : public ::ModelAnimation { /** * Check model animation skeleton match */ - inline bool IsValid(const ::Model& model) const { + bool IsValid(const ::Model& model) const { return ::IsModelAnimationValid(model, *this); } diff --git a/include/Mouse.hpp b/include/Mouse.hpp index c0708bbc..4416497a 100644 --- a/include/Mouse.hpp +++ b/include/Mouse.hpp @@ -13,83 +13,83 @@ class Mouse { /** * Detect if a mouse button has been pressed once */ - static inline bool IsButtonPressed(int button) { + static bool IsButtonPressed(int button) { return ::IsMouseButtonPressed(button); } /** * Detect if a mouse button is being pressed */ - static inline bool IsButtonDown(int button) { + static bool IsButtonDown(int button) { return ::IsMouseButtonDown(button); } /** * Detect if a mouse button has been released once */ - static inline bool IsButtonReleased(int button) { + static bool IsButtonReleased(int button) { return ::IsMouseButtonReleased(button); } - static inline bool IsButtonUp(int button) { + static bool IsButtonUp(int button) { return ::IsMouseButtonUp(button); } - static inline int GetX() { + static int GetX() { return ::GetMouseX(); } - static inline int GetY() { + static int GetY() { return ::GetMouseY(); } - static inline void SetX(int x) { + static void SetX(int x) { ::SetMousePosition(x, GetY()); } - static inline void SetY(int y) { + static void SetY(int y) { ::SetMousePosition(GetX(), y); } - static inline Vector2 GetPosition() { + static Vector2 GetPosition() { return ::GetMousePosition(); } - static inline void SetPosition(int x, int y) { + static void SetPosition(int x, int y) { ::SetMousePosition(x, y); } - static inline void SetPosition(::Vector2 position) { + static void SetPosition(::Vector2 position) { ::SetMousePosition(static_cast(position.x), static_cast(position.y)); } /** * Get mouse delta between frames */ - static inline Vector2 GetDelta() { + static Vector2 GetDelta() { return ::GetMouseDelta(); } - static inline void SetOffset(int offsetX = 0, int offsetY = 0) { + static void SetOffset(int offsetX = 0, int offsetY = 0) { ::SetMouseOffset(offsetX, offsetY); } - static inline void SetOffset(::Vector2 offset) { + static void SetOffset(::Vector2 offset) { ::SetMouseOffset(static_cast(offset.x), static_cast(offset.y)); } - static inline void SetScale(float scaleX = 1.0f, float scaleY = 1.0f) { + static void SetScale(float scaleX = 1.0f, float scaleY = 1.0f) { ::SetMouseScale(scaleX, scaleY); } - static inline void SetScale(::Vector2 scale) { + static void SetScale(::Vector2 scale) { ::SetMouseScale(scale.x, scale.y); } /** * Get mouse wheel movement for X or Y, whichever is larger */ - static inline float GetWheelMove() { + static float GetWheelMove() { return ::GetMouseWheelMove(); } @@ -98,7 +98,7 @@ class Mouse { * * @see ::GetMouseWheelMoveV() */ - static inline Vector2 GetWheelMoveV() { + static Vector2 GetWheelMoveV() { return GetMouseWheelMoveV(); } @@ -107,42 +107,42 @@ class Mouse { * * @see ::MouseCursor */ - static inline void SetCursor(int cursor = MOUSE_CURSOR_DEFAULT) { + static void SetCursor(int cursor = MOUSE_CURSOR_DEFAULT) { ::SetMouseCursor(cursor); } /** * Get touch position X for touch point 0 (relative to screen size) */ - static inline int GetTouchX() { + static int GetTouchX() { return ::GetTouchX(); } /** * Get touch position Y for touch point 0 (relative to screen size) */ - static inline int GetTouchY() { + static int GetTouchY() { return ::GetTouchY(); } /** * Get touch position XY for a touch point index (relative to screen size) */ - static inline Vector2 GetTouchPosition(int index) { + static Vector2 GetTouchPosition(int index) { return ::GetTouchPosition(index); } /** * Get a ray trace from mouse position */ - static inline Ray GetRay(::Vector2 mousePosition, const ::Camera& camera) { + static Ray GetRay(::Vector2 mousePosition, const ::Camera& camera) { return ::GetMouseRay(mousePosition, camera); } /** * Get a ray trace from mouse position */ - static inline Ray GetRay(const ::Camera& camera) { + static Ray GetRay(const ::Camera& camera) { return ::GetMouseRay(::GetMousePosition(), camera); } }; diff --git a/include/Music.hpp b/include/Music.hpp index 3eb5079b..2e6fa903 100644 --- a/include/Music.hpp +++ b/include/Music.hpp @@ -93,14 +93,14 @@ class Music : public ::Music { /** * Unload music stream */ - inline void Unload() { + void Unload() { ::UnloadMusicStream(*this); } /** * Start music playing */ - inline Music& Play() { + Music& Play() { ::PlayMusicStream(*this); return *this; } @@ -108,7 +108,7 @@ class Music : public ::Music { /** * Updates buffers for music streaming */ - inline Music& Update() { + Music& Update() { ::UpdateMusicStream(*this); return *this; } @@ -116,7 +116,7 @@ class Music : public ::Music { /** * Stop music playing */ - inline Music& Stop() { + Music& Stop() { ::StopMusicStream(*this); return *this; } @@ -124,7 +124,7 @@ class Music : public ::Music { /** * Pause music playing */ - inline Music& Pause() { + Music& Pause() { ::PauseMusicStream(*this); return *this; } @@ -132,7 +132,7 @@ class Music : public ::Music { /** * Resume music playing */ - inline Music& Resume() { + Music& Resume() { ::ResumeMusicStream(*this); return *this; } @@ -140,7 +140,7 @@ class Music : public ::Music { /** * Seek music to a position (in seconds) */ - inline Music& Seek(float position) { + Music& Seek(float position) { SeekMusicStream(*this, position); return *this; } @@ -148,14 +148,14 @@ class Music : public ::Music { /** * Check if music is playing */ - inline bool IsPlaying() const { + bool IsPlaying() const { return ::IsMusicStreamPlaying(*this); } /** * Set volume for music */ - inline Music& SetVolume(float volume) { + Music& SetVolume(float volume) { ::SetMusicVolume(*this, volume); return *this; } @@ -163,7 +163,7 @@ class Music : public ::Music { /** * Set pitch for music */ - inline Music& SetPitch(float pitch) { + Music& SetPitch(float pitch) { ::SetMusicPitch(*this, pitch); return *this; } @@ -171,7 +171,7 @@ class Music : public ::Music { /** * Set pan for a music (0.5 is center) */ - inline Music& SetPan(float pan = 0.5f) { + Music& SetPan(float pan = 0.5f) { ::SetMusicPan(*this, pan); return *this; } @@ -179,14 +179,14 @@ class Music : public ::Music { /** * Get music time length (in seconds) */ - inline float GetTimeLength() const { + float GetTimeLength() const { return ::GetMusicTimeLength(*this); } /** * Get current music time played (in seconds) */ - inline float GetTimePlayed() const { + float GetTimePlayed() const { return ::GetMusicTimePlayed(*this); } @@ -219,7 +219,7 @@ class Music : public ::Music { * * @return True or false depending on whether the Music has been loaded. */ - inline bool IsReady() const { + bool IsReady() const { return ::IsMusicReady(*this); } diff --git a/include/Ray.hpp b/include/Ray.hpp index 615f2e9f..5dd4debe 100644 --- a/include/Ray.hpp +++ b/include/Ray.hpp @@ -35,61 +35,61 @@ class Ray : public ::Ray { /** * Draw a ray line */ - inline void Draw(::Color color) const { + void Draw(::Color color) const { DrawRay(*this, color); } /** * Get collision information between ray and sphere */ - inline RayCollision GetCollision(::Vector3 center, float radius) const { + RayCollision GetCollision(::Vector3 center, float radius) const { return ::GetRayCollisionSphere(*this, center, radius); } /** * Detect collision between ray and box */ - inline RayCollision GetCollision(const ::BoundingBox& box) const { + RayCollision GetCollision(const ::BoundingBox& box) const { return ::GetRayCollisionBox(*this, box); } /** * Get collision information between ray and mesh */ - inline RayCollision GetCollision(const ::Mesh& mesh, const ::Matrix& transform) const { + RayCollision GetCollision(const ::Mesh& mesh, const ::Matrix& transform) const { return ::GetRayCollisionMesh(*this, mesh, transform); } /** * Get collision info between ray and triangle */ - inline RayCollision GetCollision(::Vector3 p1, ::Vector3 p2, ::Vector3 p3) const { + RayCollision GetCollision(::Vector3 p1, ::Vector3 p2, ::Vector3 p3) const { return ::GetRayCollisionTriangle(*this, p1, p2, p3); } /** * Get collision info between ray and quad */ - inline RayCollision GetCollision(::Vector3 p1, ::Vector3 p2, ::Vector3 p3, ::Vector3 p4) const { + RayCollision GetCollision(::Vector3 p1, ::Vector3 p2, ::Vector3 p3, ::Vector3 p4) const { return ::GetRayCollisionQuad(*this, p1, p2, p3, p4); } /** * Get a ray trace from mouse position */ - inline static Ray GetMouse(::Vector2 mousePosition, const ::Camera& camera) { + static Ray GetMouse(::Vector2 mousePosition, const ::Camera& camera) { return ::GetMouseRay(mousePosition, camera); } /** * Get a ray trace from mouse position */ - inline static Ray GetMouse(const ::Camera& camera) { + static Ray GetMouse(const ::Camera& camera) { return ::GetMouseRay(::GetMousePosition(), camera); } protected: - inline void set(const ::Ray& ray) { + void set(const ::Ray& ray) { position = ray.position; direction = ray.direction; } diff --git a/include/Rectangle.hpp b/include/Rectangle.hpp index 08d208d1..c234538d 100644 --- a/include/Rectangle.hpp +++ b/include/Rectangle.hpp @@ -34,7 +34,7 @@ class Rectangle : public ::Rectangle { return *this; } - inline ::Vector4 ToVector4() { + ::Vector4 ToVector4() { return {x, y, width, height}; } @@ -45,42 +45,42 @@ class Rectangle : public ::Rectangle { /** * Draw a color-filled rectangle */ - inline void Draw(::Color color) const { + void Draw(::Color color) const { ::DrawRectangleRec(*this, color); } - inline void Draw(::Vector2 origin, float rotation, ::Color color) const { + void Draw(::Vector2 origin, float rotation, ::Color color) const { ::DrawRectanglePro(*this, origin, rotation, color); } - inline void DrawGradientV(::Color color1, ::Color color2) const { + void DrawGradientV(::Color color1, ::Color color2) const { ::DrawRectangleGradientV(static_cast(x), static_cast(y), static_cast(width), static_cast(height), color1, color2); } - inline void DrawGradientH(::Color color1, ::Color color2) const { + void DrawGradientH(::Color color1, ::Color color2) const { ::DrawRectangleGradientH(static_cast(x), static_cast(y), static_cast(width), static_cast(height), color1, color2); } - inline void DrawGradient(::Color col1, ::Color col2, ::Color col3, ::Color col4) const { + void DrawGradient(::Color col1, ::Color col2, ::Color col3, ::Color col4) const { ::DrawRectangleGradientEx(*this, col1, col2, col3, col4); } - inline void DrawLines(::Color color) const { + void DrawLines(::Color color) const { ::DrawRectangleLines(static_cast(x), static_cast(y), static_cast(width), static_cast(height), color); } - inline void DrawLines(::Color color, float lineThick) const { + void DrawLines(::Color color, float lineThick) const { ::DrawRectangleLinesEx(*this, lineThick, color); } - inline void DrawRounded(float roundness, int segments, ::Color color) const { + void DrawRounded(float roundness, int segments, ::Color color) const { ::DrawRectangleRounded(*this, roundness, segments, color); } - inline void DrawRoundedLines(float roundness, int segments, + void DrawRoundedLines(float roundness, int segments, float lineThick, ::Color color) const { ::DrawRectangleRoundedLines(*this, roundness, segments, lineThick, color); } @@ -88,61 +88,61 @@ class Rectangle : public ::Rectangle { /** * Check collision between two rectangles */ - inline bool CheckCollision(::Rectangle rec2) const { + bool CheckCollision(::Rectangle rec2) const { return ::CheckCollisionRecs(*this, rec2); } /** * Get collision rectangle for two rectangles collision */ - inline ::Rectangle GetCollision(::Rectangle rec2) const { + ::Rectangle GetCollision(::Rectangle rec2) const { return ::GetCollisionRec(*this, rec2); } /** * Check if point is inside rectangle */ - inline bool CheckCollision(::Vector2 point) const { + bool CheckCollision(::Vector2 point) const { return ::CheckCollisionPointRec(point, *this); } /** * Check collision between circle and rectangle */ - inline bool CheckCollision(::Vector2 center, float radius) const { + bool CheckCollision(::Vector2 center, float radius) const { return ::CheckCollisionCircleRec(center, radius, *this); } - inline Vector2 GetSize() const { + Vector2 GetSize() const { return {width, height}; } - inline Rectangle& SetSize(float newWidth, float newHeight) { + Rectangle& SetSize(float newWidth, float newHeight) { width = newWidth; height = newHeight; return *this; } - inline Rectangle& SetSize(const ::Vector2& size) { + Rectangle& SetSize(const ::Vector2& size) { return SetSize(size.x, size.y); } - inline Rectangle& SetShapesTexture(const ::Texture2D& texture) { + Rectangle& SetShapesTexture(const ::Texture2D& texture) { ::SetShapesTexture(texture, *this); return *this; } - inline Vector2 GetPosition() const { + Vector2 GetPosition() const { return {x, y}; } - inline Rectangle& SetPosition(float newX, float newY) { + Rectangle& SetPosition(float newX, float newY) { x = newX; y = newY; return *this; } - inline Rectangle& SetPosition(const ::Vector2& position) { + Rectangle& SetPosition(const ::Vector2& position) { return SetPosition(position.x, position.y); } diff --git a/include/RenderTexture.hpp b/include/RenderTexture.hpp index 3b8203b7..706650d5 100644 --- a/include/RenderTexture.hpp +++ b/include/RenderTexture.hpp @@ -48,22 +48,22 @@ class RenderTexture : public ::RenderTexture { /** * Get the color buffer attachment texture. */ - inline TextureUnmanaged GetTexture() { + TextureUnmanaged GetTexture() { return texture; } - inline void SetTexture(const ::Texture& newTexture) { + void SetTexture(const ::Texture& newTexture) { texture = newTexture; } /** * Depth buffer attachment texture */ - inline TextureUnmanaged GetDepth() { + TextureUnmanaged GetDepth() { return depth; } - inline void SetDepth(const ::Texture& newDepth) { + void SetDepth(const ::Texture& newDepth) { depth = newDepth; } @@ -93,14 +93,14 @@ class RenderTexture : public ::RenderTexture { Unload(); } - inline void Unload() { + void Unload() { UnloadRenderTexture(*this); } /** * Initializes render texture for drawing */ - inline RenderTexture& BeginMode() { + RenderTexture& BeginMode() { ::BeginTextureMode(*this); return *this; } @@ -108,7 +108,7 @@ class RenderTexture : public ::RenderTexture { /** * Ends drawing to render texture */ - inline RenderTexture& EndMode() { + RenderTexture& EndMode() { ::EndTextureMode(); return *this; } @@ -123,7 +123,7 @@ class RenderTexture : public ::RenderTexture { /** * Retrieves whether or not the render texture is ready. */ - inline bool IsReady() const { + bool IsReady() const { return ::IsRenderTextureReady(*this); } diff --git a/include/Shader.hpp b/include/Shader.hpp index e277f341..ccbb7ac0 100644 --- a/include/Shader.hpp +++ b/include/Shader.hpp @@ -105,7 +105,7 @@ class Shader : public ::Shader { /** * Begin custom shader drawing. */ - inline Shader& BeginMode() { + Shader& BeginMode() { ::BeginShaderMode(*this); return *this; } @@ -113,7 +113,7 @@ class Shader : public ::Shader { /** * End custom shader drawing (use default shader). */ - inline Shader& EndMode() { + Shader& EndMode() { ::EndShaderMode(); return *this; } @@ -123,7 +123,7 @@ class Shader : public ::Shader { * * @see GetShaderLocation() */ - inline int GetLocation(const std::string& uniformName) const { + int GetLocation(const std::string& uniformName) const { return ::GetShaderLocation(*this, uniformName.c_str()); } @@ -132,7 +132,7 @@ class Shader : public ::Shader { * * @see GetShaderLocationAttrib() */ - inline int GetLocationAttrib(const std::string& attribName) const { + int GetLocationAttrib(const std::string& attribName) const { return ::GetShaderLocationAttrib(*this, attribName.c_str()); } @@ -141,7 +141,7 @@ class Shader : public ::Shader { * * @see SetShaderValue() */ - inline Shader& SetValue(int uniformLoc, const void* value, int uniformType) { + Shader& SetValue(int uniformLoc, const void* value, int uniformType) { ::SetShaderValue(*this, uniformLoc, value, uniformType); return *this; } @@ -151,7 +151,7 @@ class Shader : public ::Shader { * * @see SetShaderValueV() */ - inline Shader& SetValue(int uniformLoc, const void* value, int uniformType, int count) { + Shader& SetValue(int uniformLoc, const void* value, int uniformType, int count) { ::SetShaderValueV(*this, uniformLoc, value, uniformType, count); return *this; } @@ -161,7 +161,7 @@ class Shader : public ::Shader { * * @see SetShaderValueMatrix() */ - inline Shader& SetValue(int uniformLoc, const ::Matrix& mat) { + Shader& SetValue(int uniformLoc, const ::Matrix& mat) { ::SetShaderValueMatrix(*this, uniformLoc, mat); return *this; } @@ -171,7 +171,7 @@ class Shader : public ::Shader { * * @see SetShaderValueTexture() */ - inline Shader& SetValue(int uniformLoc, const ::Texture2D& texture) { + Shader& SetValue(int uniformLoc, const ::Texture2D& texture) { ::SetShaderValueTexture(*this, uniformLoc, texture); return *this; } diff --git a/include/Sound.hpp b/include/Sound.hpp index ef52c47f..fce156c9 100644 --- a/include/Sound.hpp +++ b/include/Sound.hpp @@ -78,7 +78,7 @@ class Sound : public ::Sound { /** * Update sound buffer with new data */ - inline Sound& Update(const void *data, int samplesCount) { + Sound& Update(const void *data, int samplesCount) { ::UpdateSound(*this, data, samplesCount); return *this; } @@ -86,7 +86,7 @@ class Sound : public ::Sound { /** * Update sound buffer with new data, assuming it's the same sample count. */ - inline Sound& Update(const void *data) { + Sound& Update(const void *data) { ::UpdateSound(*this, data, static_cast(frameCount)); return *this; } @@ -94,7 +94,7 @@ class Sound : public ::Sound { /** * Unload sound */ - inline void Unload() { + void Unload() { // Protect against calling UnloadSound() twice. if (frameCount != 0) { ::UnloadSound(*this); @@ -105,7 +105,7 @@ class Sound : public ::Sound { /** * Play a sound */ - inline Sound& Play() { + Sound& Play() { ::PlaySound(*this); return *this; } @@ -113,7 +113,7 @@ class Sound : public ::Sound { /** * Stop playing a sound */ - inline Sound& Stop() { + Sound& Stop() { ::StopSound(*this); return *this; } @@ -121,7 +121,7 @@ class Sound : public ::Sound { /** * Pause a sound */ - inline Sound& Pause() { + Sound& Pause() { ::PauseSound(*this); return *this; } @@ -129,7 +129,7 @@ class Sound : public ::Sound { /** * Resume a paused sound */ - inline Sound& Resume() { + Sound& Resume() { ::ResumeSound(*this); return *this; } @@ -137,14 +137,14 @@ class Sound : public ::Sound { /** * Check if a sound is currently playing */ - inline bool IsPlaying() const { + bool IsPlaying() const { return ::IsSoundPlaying(*this); } /** * Set volume for a sound (1.0 is max level) */ - inline Sound& SetVolume(float volume) { + Sound& SetVolume(float volume) { ::SetSoundVolume(*this, volume); return *this; } @@ -152,7 +152,7 @@ class Sound : public ::Sound { /** * Set pitch for a sound (1.0 is base level) */ - inline Sound& SetPitch(float pitch) { + Sound& SetPitch(float pitch) { ::SetSoundPitch(*this, pitch); return *this; } @@ -160,7 +160,7 @@ class Sound : public ::Sound { /** * Set pan for a sound (0.5 is center) */ - inline Sound& SetPan(float pan = 0.5f) { + Sound& SetPan(float pan = 0.5f) { ::SetSoundPan(*this, pan); return *this; } diff --git a/include/Text.hpp b/include/Text.hpp index 7e791f51..46455baa 100644 --- a/include/Text.hpp +++ b/include/Text.hpp @@ -93,14 +93,14 @@ class Text { /** * Draw text with values in class. */ - inline void Draw(const ::Vector2& position) const { + void Draw(const ::Vector2& position) const { ::DrawTextEx(font, text.c_str(), position, fontSize, spacing, color); } /** * Draw text with values in class. */ - inline void Draw(int posX, int posY) const { + void Draw(int posX, int posY) const { ::DrawTextEx(font, text.c_str(), { static_cast(posX), static_cast(posY) }, @@ -114,21 +114,21 @@ class Text { * * @see DrawTextPro() */ - inline void Draw(const ::Vector2& position, float rotation, const ::Vector2& origin = {0, 0}) const { + void Draw(const ::Vector2& position, float rotation, const ::Vector2& origin = {0, 0}) const { ::DrawTextPro(font, text.c_str(), position, origin, rotation, fontSize, spacing, color); } /** * Measure string width for default font */ - inline int Measure() const { + int Measure() const { return ::MeasureText(text.c_str(), static_cast(fontSize)); } /** * Measure string size for Font */ - inline Vector2 MeasureEx() const { + Vector2 MeasureEx() const { return ::MeasureTextEx(font, text.c_str(), fontSize, spacing); } @@ -151,7 +151,7 @@ class Text { * * @see ::DrawText */ - static inline void Draw( + static void Draw( const std::string& text, const int posX, const int posY, @@ -165,7 +165,7 @@ class Text { * * @see ::DrawText */ - static inline void Draw( + static void Draw( const std::string& text, const ::Vector2& pos, const int fontSize, @@ -178,7 +178,7 @@ class Text { * * @see ::DrawTextEx */ - static inline void Draw( + static void Draw( const ::Font& font, const std::string& text, const ::Vector2& position, @@ -193,7 +193,7 @@ class Text { * * @see ::DrawTextPro */ - static inline void Draw( + static void Draw( const ::Font& font, const std::string& text, const ::Vector2& position, diff --git a/include/TextureUnmanaged.hpp b/include/TextureUnmanaged.hpp index c85c8598..523f8a21 100644 --- a/include/TextureUnmanaged.hpp +++ b/include/TextureUnmanaged.hpp @@ -94,7 +94,7 @@ class TextureUnmanaged : public ::Texture { /** * Retrieve the width and height of the texture. */ - inline ::Vector2 GetSize() const { + ::Vector2 GetSize() const { return {static_cast(width), static_cast(height)}; } @@ -131,7 +131,7 @@ class TextureUnmanaged : public ::Texture { /** * Unload texture from GPU memory (VRAM) */ - inline void Unload() { + void Unload() { // Protect against calling UnloadTexture() twice. if (id != 0) { ::UnloadTexture(*this); @@ -142,7 +142,7 @@ class TextureUnmanaged : public ::Texture { /** * Update GPU texture with new data */ - inline TextureUnmanaged& Update(const void *pixels) { + TextureUnmanaged& Update(const void *pixels) { ::UpdateTexture(*this, pixels); return *this; } @@ -150,7 +150,7 @@ class TextureUnmanaged : public ::Texture { /** * Update GPU texture rectangle with new data */ - inline TextureUnmanaged& Update(::Rectangle rec, const void *pixels) { + TextureUnmanaged& Update(::Rectangle rec, const void *pixels) { UpdateTextureRec(*this, rec, pixels); return *this; } @@ -158,21 +158,21 @@ class TextureUnmanaged : public ::Texture { /** * Get pixel data from GPU texture and return an Image */ - inline ::Image GetData() const { + ::Image GetData() const { return ::LoadImageFromTexture(*this); } /** * Get pixel data from GPU texture and return an Image */ - inline operator Image() { + operator Image() { return GetData(); } /** * Generate GPU mipmaps for a texture */ - inline TextureUnmanaged& GenMipmaps() { + TextureUnmanaged& GenMipmaps() { ::GenTextureMipmaps(this); return *this; } @@ -180,7 +180,7 @@ class TextureUnmanaged : public ::Texture { /** * Set texture scaling filter mode */ - inline TextureUnmanaged& SetFilter(int filterMode) { + TextureUnmanaged& SetFilter(int filterMode) { ::SetTextureFilter(*this, filterMode); return *this; } @@ -188,7 +188,7 @@ class TextureUnmanaged : public ::Texture { /** * Set texture wrapping mode */ - inline TextureUnmanaged& SetWrap(int wrapMode) { + TextureUnmanaged& SetWrap(int wrapMode) { ::SetTextureWrap(*this, wrapMode); return *this; } @@ -198,7 +198,7 @@ class TextureUnmanaged : public ::Texture { * * @see ::DrawTexture() */ - inline void Draw(int posX = 0, int posY = 0, ::Color tint = {255, 255, 255, 255}) const { + void Draw(int posX = 0, int posY = 0, ::Color tint = {255, 255, 255, 255}) const { ::DrawTexture(*this, posX, posY, tint); } @@ -207,7 +207,7 @@ class TextureUnmanaged : public ::Texture { * * @see ::DrawTextureV() */ - inline void Draw(::Vector2 position, ::Color tint = {255, 255, 255, 255}) const { + void Draw(::Vector2 position, ::Color tint = {255, 255, 255, 255}) const { ::DrawTextureV(*this, position, tint); } @@ -216,7 +216,7 @@ class TextureUnmanaged : public ::Texture { * * @see ::DrawTextureEx() */ - inline void Draw(::Vector2 position, float rotation, float scale = 1.0f, + void Draw(::Vector2 position, float rotation, float scale = 1.0f, ::Color tint = {255, 255, 255, 255}) const { ::DrawTextureEx(*this, position, rotation, scale, tint); } @@ -226,7 +226,7 @@ class TextureUnmanaged : public ::Texture { * * @see ::DrawTextureRec() */ - inline void Draw(::Rectangle sourceRec, ::Vector2 position = {0, 0}, + void Draw(::Rectangle sourceRec, ::Vector2 position = {0, 0}, ::Color tint = {255, 255, 255, 255}) const { ::DrawTextureRec(*this, sourceRec, position, tint); } @@ -236,7 +236,7 @@ class TextureUnmanaged : public ::Texture { * * @see ::DrawTexturePro() */ - inline void Draw(::Rectangle sourceRec, ::Rectangle destRec, ::Vector2 origin = {0, 0}, + void Draw(::Rectangle sourceRec, ::Rectangle destRec, ::Vector2 origin = {0, 0}, float rotation = 0, ::Color tint = {255, 255, 255, 255}) const { ::DrawTexturePro(*this, sourceRec, destRec, origin, rotation, tint); } @@ -246,7 +246,7 @@ class TextureUnmanaged : public ::Texture { * * @see ::DrawTextureNPatch() */ - inline void Draw(::NPatchInfo nPatchInfo, ::Rectangle destRec, ::Vector2 origin = {0, 0}, + void Draw(::NPatchInfo nPatchInfo, ::Rectangle destRec, ::Vector2 origin = {0, 0}, float rotation = 0, ::Color tint = {255, 255, 255, 255}) const { ::DrawTextureNPatch(*this, nPatchInfo, destRec, origin, rotation, tint); } @@ -256,7 +256,7 @@ class TextureUnmanaged : public ::Texture { * * @see ::DrawBillboard() */ - inline void DrawBillboard(const ::Camera& camera, + void DrawBillboard(const ::Camera& camera, ::Vector3 position, float size, ::Color tint = {255, 255, 255, 255}) const { ::DrawBillboard(camera, *this, position, size, tint); @@ -267,7 +267,7 @@ class TextureUnmanaged : public ::Texture { * * @see ::DrawBillboardRec() */ - inline void DrawBillboard(const ::Camera& camera, + void DrawBillboard(const ::Camera& camera, ::Rectangle source, ::Vector3 position, ::Vector2 size, ::Color tint = {255, 255, 255, 255}) const { DrawBillboardRec(camera, *this, source, position, size, tint); @@ -278,7 +278,7 @@ class TextureUnmanaged : public ::Texture { * * @see ::DrawBillboardPro() */ - inline void DrawBillboard(const ::Camera& camera, + void DrawBillboard(const ::Camera& camera, ::Rectangle source, Vector3 position, ::Vector3 up, Vector2 size, Vector2 origin, float rotation = 0.0f, ::Color tint = {255, 255, 255, 255}) const { @@ -288,12 +288,12 @@ class TextureUnmanaged : public ::Texture { /** * Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) */ - inline TextureUnmanaged& SetMaterial(::Material *material, int mapType = MATERIAL_MAP_NORMAL) { + TextureUnmanaged& SetMaterial(::Material *material, int mapType = MATERIAL_MAP_NORMAL) { ::SetMaterialTexture(material, mapType, *this); return *this; } - inline TextureUnmanaged& SetMaterial(const ::Material& material, int mapType = MATERIAL_MAP_NORMAL) { + TextureUnmanaged& SetMaterial(const ::Material& material, int mapType = MATERIAL_MAP_NORMAL) { ::SetMaterialTexture((::Material*)(&material), mapType, *this); return *this; } @@ -301,7 +301,7 @@ class TextureUnmanaged : public ::Texture { /** * Set texture and rectangle to be used on shapes drawing. */ - inline TextureUnmanaged& SetShapes(const ::Rectangle& source) { + TextureUnmanaged& SetShapes(const ::Rectangle& source) { ::SetShapesTexture(*this, source); return *this; } @@ -309,7 +309,7 @@ class TextureUnmanaged : public ::Texture { /** * Set shader uniform value for texture (sampler2d) */ - inline TextureUnmanaged& SetShaderValue(const ::Shader& shader, int locIndex) { + TextureUnmanaged& SetShaderValue(const ::Shader& shader, int locIndex) { ::SetShaderValueTexture(shader, locIndex, *this); return *this; } diff --git a/include/Touch.hpp b/include/Touch.hpp index ecdb84b7..ec5a5749 100644 --- a/include/Touch.hpp +++ b/include/Touch.hpp @@ -12,35 +12,35 @@ class Touch { /** * Get touch position X for touch point 0 (relative to screen size) */ - inline static int GetX() { + static int GetX() { return ::GetTouchX(); } /** * Get touch position Y for touch point 0 (relative to screen size) */ - inline static int GetY() { + static int GetY() { return ::GetTouchY(); } /** * Get touch position XY for a touch point index (relative to screen size) */ - inline static Vector2 GetPosition(int index) { + static Vector2 GetPosition(int index) { return ::GetTouchPosition(index); } /** * Get touch point identifier for given index */ - inline static int GetPointId(int index) { + static int GetPointId(int index) { return ::GetTouchPointId(index); } /** * Get number of touch points */ - inline static int GetPointCount() { + static int GetPointCount() { return ::GetTouchPointCount(); } }; diff --git a/include/Vector2.hpp b/include/Vector2.hpp index 0aa9d759..5cb605aa 100644 --- a/include/Vector2.hpp +++ b/include/Vector2.hpp @@ -49,11 +49,11 @@ class Vector2 : public ::Vector2 { return !(*this == other); } - inline std::string ToString() const { + std::string ToString() const { return TextFormat("Vector2(%f, %f)", x, y); } - inline operator std::string() const { + operator std::string() const { return ToString(); } @@ -61,14 +61,14 @@ class Vector2 : public ::Vector2 { /** * Add two vectors (v1 + v2) */ - inline Vector2 Add(const ::Vector2& vector2) const { + Vector2 Add(const ::Vector2& vector2) const { return Vector2Add(*this, vector2); } /** * Add two vectors (v1 + v2) */ - inline Vector2 operator+(const ::Vector2& vector2) const { + Vector2 operator+(const ::Vector2& vector2) const { return Vector2Add(*this, vector2); } @@ -84,14 +84,14 @@ class Vector2 : public ::Vector2 { /** * Subtract two vectors (v1 - v2) */ - inline Vector2 Subtract(const ::Vector2& vector2) const { + Vector2 Subtract(const ::Vector2& vector2) const { return Vector2Subtract(*this, vector2); } /** * Subtract two vectors (v1 - v2) */ - inline Vector2 operator-(const ::Vector2& vector2) const { + Vector2 operator-(const ::Vector2& vector2) const { return Vector2Subtract(*this, vector2); } @@ -107,28 +107,28 @@ class Vector2 : public ::Vector2 { /** * Negate vector */ - inline Vector2 Negate() const { + Vector2 Negate() const { return Vector2Negate(*this); } /** * Negate vector */ - inline Vector2 operator-() const { + Vector2 operator-() const { return Vector2Negate(*this); } /** * Multiply vector by vector */ - inline Vector2 Multiply(const ::Vector2& vector2) const { + Vector2 Multiply(const ::Vector2& vector2) const { return Vector2Multiply(*this, vector2); } /** * Multiply vector by vector */ - inline Vector2 operator*(const ::Vector2& vector2) const { + Vector2 operator*(const ::Vector2& vector2) const { return Vector2Multiply(*this, vector2); } @@ -144,14 +144,14 @@ class Vector2 : public ::Vector2 { /** * Scale vector (multiply by value) */ - inline Vector2 Scale(const float scale) const { + Vector2 Scale(const float scale) const { return Vector2Scale(*this, scale); } /** * Scale vector (multiply by value) */ - inline Vector2 operator*(const float scale) const { + Vector2 operator*(const float scale) const { return Vector2Scale(*this, scale); } @@ -167,14 +167,14 @@ class Vector2 : public ::Vector2 { /** * Divide vector by vector */ - inline Vector2 Divide(const ::Vector2& vector2) const { + Vector2 Divide(const ::Vector2& vector2) const { return Vector2Divide(*this, vector2); } /** * Divide vector by vector */ - inline Vector2 operator/(const ::Vector2& vector2) const { + Vector2 operator/(const ::Vector2& vector2) const { return Vector2Divide(*this, vector2); } @@ -190,14 +190,14 @@ class Vector2 : public ::Vector2 { /** * Divide vector by value */ - inline Vector2 Divide(const float div) const { + Vector2 Divide(const float div) const { return ::Vector2{x / div, y / div}; } /** * Divide vector by value */ - inline Vector2 operator/(const float div) const { + Vector2 operator/(const float div) const { return Divide(div); } @@ -214,200 +214,200 @@ class Vector2 : public ::Vector2 { /** * Normalize provided vector */ - inline Vector2 Normalize() const { + Vector2 Normalize() const { return Vector2Normalize(*this); } /** * Transforms a Vector2 by a given Matrix */ - inline Vector2 Transform(::Matrix mat) const { + Vector2 Transform(::Matrix mat) const { return ::Vector2Transform(*this, mat); } /** * Calculate linear interpolation between two vectors */ - inline Vector2 Lerp(const ::Vector2& vector2, float amount) const { + Vector2 Lerp(const ::Vector2& vector2, float amount) const { return Vector2Lerp(*this, vector2, amount); } /** * Calculate reflected vector to normal */ - inline Vector2 Reflect(const ::Vector2& normal) const { + Vector2 Reflect(const ::Vector2& normal) const { return Vector2Reflect(*this, normal); } /** * Rotate Vector by float in radians */ - inline Vector2 Rotate(float angle) const { + Vector2 Rotate(float angle) const { return Vector2Rotate(*this, angle); } /** * Move Vector towards target */ - inline Vector2 MoveTowards(const ::Vector2& target, float maxDistance) const { + Vector2 MoveTowards(const ::Vector2& target, float maxDistance) const { return Vector2MoveTowards(*this, target, maxDistance); } /** * Invert the given vector */ - inline Vector2 Invert() const { + Vector2 Invert() const { return ::Vector2Invert(*this); } /** * Clamp the components of the vector between */ - inline Vector2 Clamp(::Vector2 min, ::Vector2 max) const { + Vector2 Clamp(::Vector2 min, ::Vector2 max) const { return ::Vector2Clamp(*this, min, max); } /** * // Clamp the magnitude of the vector between two min and max values */ - inline Vector2 Clamp(float min, float max) const { + Vector2 Clamp(float min, float max) const { return ::Vector2ClampValue(*this, min, max); } /** * Check whether two given vectors are almost equal */ - inline int Equals(::Vector2 q) const { + int Equals(::Vector2 q) const { return ::Vector2Equals(*this, q); } /** * Calculate vector length */ - inline float Length() const { + float Length() const { return Vector2Length(*this); } /** * Calculate vector square length */ - inline float LengthSqr() const { + float LengthSqr() const { return Vector2LengthSqr(*this); } /** * Calculate two vectors dot product */ - inline float DotProduct(const ::Vector2& vector2) const { + float DotProduct(const ::Vector2& vector2) const { return Vector2DotProduct(*this, vector2); } /** * Calculate distance between two vectors */ - inline float Distance(const ::Vector2& vector2) const { + float Distance(const ::Vector2& vector2) const { return Vector2Distance(*this, vector2); } /** * Calculate square distance between two vectors */ - inline float DistanceSqr(::Vector2 v2) const { + float DistanceSqr(::Vector2 v2) const { return ::Vector2DistanceSqr(*this, v2); } /** * Calculate angle from two vectors in X-axis */ - inline float Angle(const ::Vector2& vector2) const { + float Angle(const ::Vector2& vector2) const { return Vector2Angle(*this, vector2); } /** * Vector with components value 0.0f */ - static inline Vector2 Zero() { + static Vector2 Zero() { return Vector2Zero(); } /** * Vector with components value 1.0f */ - static inline Vector2 One() { + static Vector2 One() { return Vector2One(); } #endif - inline void DrawPixel(::Color color = {0, 0, 0, 255}) const { + void DrawPixel(::Color color = {0, 0, 0, 255}) const { ::DrawPixelV(*this, color); } - inline void DrawLine(::Vector2 endPos, ::Color color = {0, 0, 0, 255}) const { + void DrawLine(::Vector2 endPos, ::Color color = {0, 0, 0, 255}) const { ::DrawLineV(*this, endPos, color); } - inline void DrawLine(::Vector2 endPos, float thick, ::Color color = {0, 0, 0, 255}) const { + void DrawLine(::Vector2 endPos, float thick, ::Color color = {0, 0, 0, 255}) const { ::DrawLineEx(*this, endPos, thick, color); } - inline void DrawLineBezier(::Vector2 endPos, float thick, ::Color color = {0, 0, 0, 255}) const { + void DrawLineBezier(::Vector2 endPos, float thick, ::Color color = {0, 0, 0, 255}) const { ::DrawLineBezier(*this, endPos, thick, color); } /** * Draw a color-filled circle (Vector version) */ - inline void DrawCircle(float radius, ::Color color = {0, 0, 0, 255}) const { + void DrawCircle(float radius, ::Color color = {0, 0, 0, 255}) const { ::DrawCircleV(*this, radius, color); } - inline void DrawRectangle(::Vector2 size, ::Color color = {0, 0, 0, 255}) const { + void DrawRectangle(::Vector2 size, ::Color color = {0, 0, 0, 255}) const { ::DrawRectangleV(*this, size, color); } - inline void DrawPoly(int sides, float radius, float rotation, ::Color color = {0, 0, 0, 255}) const { + void DrawPoly(int sides, float radius, float rotation, ::Color color = {0, 0, 0, 255}) const { ::DrawPoly(*this, sides, radius, rotation, color); } /** * Check collision between two circles */ - inline bool CheckCollisionCircle(float radius1, ::Vector2 center2, float radius2) const { + bool CheckCollisionCircle(float radius1, ::Vector2 center2, float radius2) const { return ::CheckCollisionCircles(*this, radius1, center2, radius2); } /** * Check collision between circle and rectangle */ - inline bool CheckCollisionCircle(float radius, ::Rectangle rec) const { + bool CheckCollisionCircle(float radius, ::Rectangle rec) const { return ::CheckCollisionCircleRec(*this, radius, rec); } /** * Check if point is inside rectangle */ - inline bool CheckCollision(::Rectangle rec) const { + bool CheckCollision(::Rectangle rec) const { return ::CheckCollisionPointRec(*this, rec); } /** * Check if point is inside circle */ - inline bool CheckCollision(::Vector2 center, float radius) const { + bool CheckCollision(::Vector2 center, float radius) const { return ::CheckCollisionPointCircle(*this, center, radius); } /** * Check if point is inside a triangle */ - inline bool CheckCollision(::Vector2 p1, ::Vector2 p2, ::Vector2 p3) const { + bool CheckCollision(::Vector2 p1, ::Vector2 p2, ::Vector2 p3) const { return ::CheckCollisionPointTriangle(*this, p1, p2, p3); } /** * Check the collision between two lines defined by two points each, returns collision point by reference */ - inline bool CheckCollisionLines( + bool CheckCollisionLines( ::Vector2 endPos1, ::Vector2 startPos2, ::Vector2 endPos2, ::Vector2 *collisionPoint) const { @@ -417,7 +417,7 @@ class Vector2 : public ::Vector2 { /** * Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] */ - inline bool CheckCollisionPointLine(::Vector2 p1, ::Vector2 p2, int threshold = 1) const { + bool CheckCollisionPointLine(::Vector2 p1, ::Vector2 p2, int threshold = 1) const { return ::CheckCollisionPointLine(*this, p1, p2, threshold); } diff --git a/include/Vector3.hpp b/include/Vector3.hpp index 11520ef1..2492d85e 100644 --- a/include/Vector3.hpp +++ b/include/Vector3.hpp @@ -47,11 +47,11 @@ class Vector3 : public ::Vector3 { return !(*this == other); } - inline std::string ToString() const { + std::string ToString() const { return TextFormat("Vector3(%f, %f, %f)", x, y, z); } - inline operator std::string() const { + operator std::string() const { return ToString(); } @@ -59,14 +59,14 @@ class Vector3 : public ::Vector3 { /** * Add two vectors */ - inline Vector3 Add(const ::Vector3& vector3) const { + Vector3 Add(const ::Vector3& vector3) const { return Vector3Add(*this, vector3); } /** * Add two vectors */ - inline Vector3 operator+(const ::Vector3& vector3) const { + Vector3 operator+(const ::Vector3& vector3) const { return Vector3Add(*this, vector3); } @@ -79,14 +79,14 @@ class Vector3 : public ::Vector3 { /** * Subtract two vectors. */ - inline Vector3 Subtract(const ::Vector3& vector3) const { + Vector3 Subtract(const ::Vector3& vector3) const { return Vector3Subtract(*this, vector3); } /** * Subtract two vectors. */ - inline Vector3 operator-(const ::Vector3& vector3) const { + Vector3 operator-(const ::Vector3& vector3) const { return Vector3Subtract(*this, vector3); } @@ -99,28 +99,28 @@ class Vector3 : public ::Vector3 { /** * Negate provided vector (invert direction) */ - inline Vector3 Negate() const { + Vector3 Negate() const { return Vector3Negate(*this); } /** * Negate provided vector (invert direction) */ - inline Vector3 operator-() const { + Vector3 operator-() const { return Vector3Negate(*this); } /** * Multiply vector by vector */ - inline Vector3 Multiply(const ::Vector3& vector3) const { + Vector3 Multiply(const ::Vector3& vector3) const { return Vector3Multiply(*this, vector3); } /** * Multiply vector by vector */ - inline Vector3 operator*(const ::Vector3& vector3) const { + Vector3 operator*(const ::Vector3& vector3) const { return Vector3Multiply(*this, vector3); } @@ -136,14 +136,14 @@ class Vector3 : public ::Vector3 { /** * Multiply vector by scalar */ - inline Vector3 Scale(const float scaler) const { + Vector3 Scale(const float scaler) const { return Vector3Scale(*this, scaler); } /** * Multiply vector by scalar */ - inline Vector3 operator*(const float scaler) const { + Vector3 operator*(const float scaler) const { return Vector3Scale(*this, scaler); } @@ -159,14 +159,14 @@ class Vector3 : public ::Vector3 { /** * Divide vector by vector */ - inline Vector3 Divide(const ::Vector3& vector3) const { + Vector3 Divide(const ::Vector3& vector3) const { return Vector3Divide(*this, vector3); } /** * Divide vector by vector */ - inline Vector3 operator/(const ::Vector3& vector3) const { + Vector3 operator/(const ::Vector3& vector3) const { return Vector3Divide(*this, vector3); } @@ -184,14 +184,14 @@ class Vector3 : public ::Vector3 { /** * Divide a vector by a value. */ - inline Vector3 Divide(const float div) const { + Vector3 Divide(const float div) const { return ::Vector3{x / div, y / div, z / div}; } /** * Divide a vector by a value. */ - inline Vector3 operator/(const float div) const { + Vector3 operator/(const float div) const { return Divide(div); } @@ -209,80 +209,80 @@ class Vector3 : public ::Vector3 { /** * Calculate vector length */ - inline float Length() const { + float Length() const { return Vector3Length(*this); } - inline Vector3 Normalize() const { + Vector3 Normalize() const { return Vector3Normalize(*this); } - inline float DotProduct(const ::Vector3& vector3) const { + float DotProduct(const ::Vector3& vector3) const { return Vector3DotProduct(*this, vector3); } - inline float Distance(const ::Vector3& vector3) const { + float Distance(const ::Vector3& vector3) const { return Vector3Distance(*this, vector3); } - inline Vector3 Lerp(const ::Vector3& vector3, const float amount) const { + Vector3 Lerp(const ::Vector3& vector3, const float amount) const { return Vector3Lerp(*this, vector3, amount); } - inline Vector3 CrossProduct(const ::Vector3& vector3) const { + Vector3 CrossProduct(const ::Vector3& vector3) const { return Vector3CrossProduct(*this, vector3); } - inline Vector3 Perpendicular() const { + Vector3 Perpendicular() const { return Vector3Perpendicular(*this); } - inline void OrthoNormalize(::Vector3* vector3) { + void OrthoNormalize(::Vector3* vector3) { Vector3OrthoNormalize(this, vector3); } - inline Vector3 Transform(const ::Matrix& matrix) const { + Vector3 Transform(const ::Matrix& matrix) const { return Vector3Transform(*this, matrix); } - inline Vector3 RotateByQuaternion(const ::Quaternion& quaternion) const { + Vector3 RotateByQuaternion(const ::Quaternion& quaternion) const { return Vector3RotateByQuaternion(*this, quaternion); } - inline Vector3 Reflect(const ::Vector3& normal) const { + Vector3 Reflect(const ::Vector3& normal) const { return Vector3Reflect(*this, normal); } - inline Vector3 Min(const ::Vector3& vector3) const { + Vector3 Min(const ::Vector3& vector3) const { return Vector3Min(*this, vector3); } - inline Vector3 Max(const ::Vector3& vector3) const { + Vector3 Max(const ::Vector3& vector3) const { return Vector3Max(*this, vector3); } - inline Vector3 Barycenter(const ::Vector3& a, const ::Vector3& b, const ::Vector3& c) const { + Vector3 Barycenter(const ::Vector3& a, const ::Vector3& b, const ::Vector3& c) const { return Vector3Barycenter(*this, a, b, c); } - static inline Vector3 Zero() { + static Vector3 Zero() { return Vector3Zero(); } - static inline Vector3 One() { + static Vector3 One() { return Vector3One(); } #endif - inline void DrawLine3D(const ::Vector3& endPos, ::Color color) const { + void DrawLine3D(const ::Vector3& endPos, ::Color color) const { ::DrawLine3D(*this, endPos, color); } - inline void DrawPoint3D(::Color color) const { + void DrawPoint3D(::Color color) const { ::DrawPoint3D(*this, color); } - inline void DrawCircle3D( + void DrawCircle3D( float radius, const ::Vector3& rotationAxis, float rotationAngle, @@ -290,52 +290,52 @@ class Vector3 : public ::Vector3 { ::DrawCircle3D(*this, radius, rotationAxis, rotationAngle, color); } - inline void DrawCube(float width, float height, float length, ::Color color) const { + void DrawCube(float width, float height, float length, ::Color color) const { ::DrawCube(*this, width, height, length, color); } - inline void DrawCube(const ::Vector3& size, ::Color color) const { + void DrawCube(const ::Vector3& size, ::Color color) const { ::DrawCubeV(*this, size, color); } - inline void DrawCubeWires(float width, float height, float length, ::Color color) const { + void DrawCubeWires(float width, float height, float length, ::Color color) const { ::DrawCubeWires(*this, width, height, length, color); } - inline void DrawCubeWires(const ::Vector3& size, ::Color color) const { + void DrawCubeWires(const ::Vector3& size, ::Color color) const { ::DrawCubeWiresV(*this, size, color); } - inline void DrawSphere(float radius, ::Color color) const { + void DrawSphere(float radius, ::Color color) const { ::DrawSphere(*this, radius, color); } - inline void DrawSphere(float radius, int rings, int slices, ::Color color) const { + void DrawSphere(float radius, int rings, int slices, ::Color color) const { ::DrawSphereEx(*this, radius, rings, slices, color); } - inline void DrawSphereWires(float radius, int rings, int slices, ::Color color) const { + void DrawSphereWires(float radius, int rings, int slices, ::Color color) const { ::DrawSphereWires(*this, radius, rings, slices, color); } - inline void DrawCylinder(float radiusTop, float radiusBottom, float height, + void DrawCylinder(float radiusTop, float radiusBottom, float height, int slices, ::Color color) const { ::DrawCylinder(*this, radiusTop, radiusBottom, height, slices, color); } - inline void DrawCylinderWires(float radiusTop, float radiusBottom, float height, + void DrawCylinderWires(float radiusTop, float radiusBottom, float height, int slices, ::Color color) const { ::DrawCylinderWires(*this, radiusTop, radiusBottom, height, slices, color); } - inline void DrawPlane(const ::Vector2& size, ::Color color) const { + void DrawPlane(const ::Vector2& size, ::Color color) const { ::DrawPlane(*this, size, color); } /** * Detect collision between two spheres */ - inline bool CheckCollision(float radius1, const ::Vector3& center2, float radius2) const { + bool CheckCollision(float radius1, const ::Vector3& center2, float radius2) const { return CheckCollisionSpheres(*this, radius1, center2, radius2); } diff --git a/include/Vector4.hpp b/include/Vector4.hpp index 9d788875..6f12640f 100644 --- a/include/Vector4.hpp +++ b/include/Vector4.hpp @@ -52,7 +52,7 @@ class Vector4 : public ::Vector4 { return !(*this == other); } - inline ::Rectangle ToRectangle() const { + ::Rectangle ToRectangle() const { return {x, y, z, w}; } @@ -60,52 +60,52 @@ class Vector4 : public ::Vector4 { return {x, y, z, w}; } - inline std::string ToString() const { + std::string ToString() const { return TextFormat("Vector4(%f, %f, %f, %f)", x, y, z, w); } - inline operator std::string() const { + operator std::string() const { return ToString(); } #ifndef RAYLIB_CPP_NO_MATH - inline Vector4 Multiply(const ::Vector4& vector4) const { + Vector4 Multiply(const ::Vector4& vector4) const { return QuaternionMultiply(*this, vector4); } - inline Vector4 operator*(const ::Vector4& vector4) const { + Vector4 operator*(const ::Vector4& vector4) const { return QuaternionMultiply(*this, vector4); } - inline Vector4 Lerp(const ::Vector4& vector4, float amount) const { + Vector4 Lerp(const ::Vector4& vector4, float amount) const { return QuaternionLerp(*this, vector4, amount); } - inline Vector4 Nlerp(const ::Vector4& vector4, float amount) const { + Vector4 Nlerp(const ::Vector4& vector4, float amount) const { return QuaternionNlerp(*this, vector4, amount); } - inline Vector4 Slerp(const ::Vector4& vector4, float amount) const { + Vector4 Slerp(const ::Vector4& vector4, float amount) const { return QuaternionSlerp(*this, vector4, amount); } - inline Matrix ToMatrix() const { + Matrix ToMatrix() const { return QuaternionToMatrix(*this); } - inline float Length() const { + float Length() const { return QuaternionLength(*this); } - inline Vector4 Normalize() const { + Vector4 Normalize() const { return QuaternionNormalize(*this); } - inline Vector4 Invert() const { + Vector4 Invert() const { return QuaternionInvert(*this); } - inline void ToAxisAngle(::Vector3 *outAxis, float *outAngle) const { + void ToAxisAngle(::Vector3 *outAxis, float *outAngle) const { QuaternionToAxisAngle(*this, outAxis, outAngle); } @@ -120,40 +120,40 @@ class Vector4 : public ::Vector4 { return std::pair(outAxis, outAngle); } - inline Vector4 Transform(const ::Matrix& matrix) const { + Vector4 Transform(const ::Matrix& matrix) const { return ::QuaternionTransform(*this, matrix); } - static inline Vector4 Identity() { + static Vector4 Identity() { return ::QuaternionIdentity(); } - static inline Vector4 FromVector3ToVector3(const ::Vector3& from , const ::Vector3& to) { + static Vector4 FromVector3ToVector3(const ::Vector3& from , const ::Vector3& to) { return ::QuaternionFromVector3ToVector3(from , to); } - static inline Vector4 FromMatrix(const ::Matrix& matrix) { + static Vector4 FromMatrix(const ::Matrix& matrix) { return ::QuaternionFromMatrix(matrix); } - static inline Vector4 FromAxisAngle(const ::Vector3& axis, const float angle) { + static Vector4 FromAxisAngle(const ::Vector3& axis, const float angle) { return ::QuaternionFromAxisAngle(axis, angle); } - static inline Vector4 FromEuler(const float pitch, const float yaw, const float roll) { + static Vector4 FromEuler(const float pitch, const float yaw, const float roll) { return ::QuaternionFromEuler(pitch, yaw, roll); } - static inline Vector4 FromEuler(const ::Vector3& vector3) { + static Vector4 FromEuler(const ::Vector3& vector3) { return ::QuaternionFromEuler(vector3.x, vector3.y, vector3.z); } - inline Vector3 ToEuler() const { + Vector3 ToEuler() const { return ::QuaternionToEuler(*this); } #endif - inline Color ColorFromNormalized() const { + Color ColorFromNormalized() const { return ::ColorFromNormalized(*this); } diff --git a/include/VrStereoConfig.hpp b/include/VrStereoConfig.hpp index 391a08af..0dd593ef 100644 --- a/include/VrStereoConfig.hpp +++ b/include/VrStereoConfig.hpp @@ -17,7 +17,7 @@ class VrStereoConfig : public ::VrStereoConfig { /** * Load VR stereo config for VR simulator device parameters */ - inline void Load(const ::VrDeviceInfo& info) { + void Load(const ::VrDeviceInfo& info) { set(LoadVrStereoConfig(info)); } @@ -31,7 +31,7 @@ class VrStereoConfig : public ::VrStereoConfig { /** * Begin stereo rendering */ - inline VrStereoConfig& BeginMode() { + VrStereoConfig& BeginMode() { ::BeginVrStereoMode(*this); return *this; } @@ -39,7 +39,7 @@ class VrStereoConfig : public ::VrStereoConfig { /** * End stereo rendering */ - inline VrStereoConfig& EndMode() { + VrStereoConfig& EndMode() { ::EndVrStereoMode(); return *this; } @@ -47,7 +47,7 @@ class VrStereoConfig : public ::VrStereoConfig { /** * Unload VR stereo config */ - inline void Unload() { + void Unload() { ::UnloadVrStereoConfig(*this); } diff --git a/include/Wave.hpp b/include/Wave.hpp index 35f7ae25..757589be 100644 --- a/include/Wave.hpp +++ b/include/Wave.hpp @@ -107,14 +107,14 @@ class Wave : public ::Wave { /** * Copy a wave to a new wave */ - inline ::Wave Copy() const { + ::Wave Copy() const { return ::WaveCopy(*this); } /** * Crop a wave to defined samples range */ - inline Wave& Crop(int initSample, int finalSample) { + Wave& Crop(int initSample, int finalSample) { ::WaveCrop(this, initSample, finalSample); return *this; } @@ -122,7 +122,7 @@ class Wave : public ::Wave { /** * Convert wave data to desired format */ - inline Wave& Format(int SampleRate, int SampleSize, int Channels = 2) { + Wave& Format(int SampleRate, int SampleSize, int Channels = 2) { ::WaveFormat(this, SampleRate, SampleSize, Channels); return *this; } @@ -130,21 +130,21 @@ class Wave : public ::Wave { /** * Load samples data from wave as a floats array */ - inline float* LoadSamples() { + float* LoadSamples() { return ::LoadWaveSamples(*this); } /** * Unload samples data loaded with LoadWaveSamples() */ - inline static void UnloadSamples(float *samples) { + static void UnloadSamples(float *samples) { ::UnloadWaveSamples(samples); } /** * Export wave data to file, returns true on success */ - inline bool Export(const std::string& fileName) { + bool Export(const std::string& fileName) { // TODO(RobLoach): Throw exception on error. return ::ExportWave(*this, fileName.c_str()); } @@ -152,7 +152,7 @@ class Wave : public ::Wave { /** * Export wave sample data to code (.h), returns true on success */ - inline bool ExportAsCode(const std::string& fileName) { + bool ExportAsCode(const std::string& fileName) { // TODO(RobLoach): Throw exception on error. return ::ExportWaveAsCode(*this, fileName.c_str()); } @@ -171,14 +171,14 @@ class Wave : public ::Wave { /** * Load sound from wave data */ - inline ::Sound LoadSound() { + ::Sound LoadSound() { return ::LoadSoundFromWave(*this); } /** * Load sound from wave data */ - inline operator ::Sound() { + operator ::Sound() { return LoadSound(); } @@ -211,7 +211,7 @@ class Wave : public ::Wave { * * @return True or false depending on whether the wave data has been loaded. */ - inline bool IsReady() const { + bool IsReady() const { return ::IsWaveReady(*this); } diff --git a/include/Window.hpp b/include/Window.hpp index dc00759e..dfa9d7c4 100644 --- a/include/Window.hpp +++ b/include/Window.hpp @@ -59,7 +59,7 @@ class Window { * * @throws raylib::RaylibException Thrown if the window failed to initiate. */ - inline void Init(int width = 800, int height = 450, const std::string& title = "raylib", unsigned int flags = 0) { + void Init(int width = 800, int height = 450, const std::string& title = "raylib", unsigned int flags = 0) { if (flags != 0) { ::SetConfigFlags(flags); } @@ -72,14 +72,14 @@ class Window { /** * Check if KEY_ESCAPE pressed or Close icon pressed */ - inline bool ShouldClose() const { + bool ShouldClose() const { return ::WindowShouldClose(); } /** * Close window and unload OpenGL context */ - inline void Close() { + void Close() { if (::IsWindowReady()) { ::CloseWindow(); } @@ -88,63 +88,63 @@ class Window { /** * Check if cursor is on the current screen */ - inline bool IsCursorOnScreen() const { + bool IsCursorOnScreen() const { return ::IsCursorOnScreen(); } /** * Check if window is currently fullscreen */ - inline bool IsFullscreen() const { + bool IsFullscreen() const { return ::IsWindowFullscreen(); } /** * Check if window is currently hidden */ - inline bool IsHidden() const { + bool IsHidden() const { return ::IsWindowHidden(); } /** * Check if window is currently minimized */ - inline bool IsMinimized() const { + bool IsMinimized() const { return ::IsWindowMinimized(); } /** * Check if window is currently minimized */ - inline bool IsMaximized() const { + bool IsMaximized() const { return ::IsWindowMaximized(); } /** * Check if window is currently focused */ - inline bool IsFocused() const { + bool IsFocused() const { return ::IsWindowFocused(); } /** * Check if window has been resized last frame */ - inline bool IsResized() const { + bool IsResized() const { return ::IsWindowResized(); } /** * Check if one specific window flag is enabled */ - inline bool IsState(unsigned int flag) const { + bool IsState(unsigned int flag) const { return ::IsWindowState(flag); } /** * Set window configuration state using flags */ - inline Window& SetState(unsigned int flag) { + Window& SetState(unsigned int flag) { ::SetWindowState(flag); return *this; } @@ -152,7 +152,7 @@ class Window { /** * Clear window configuration state flags */ - inline Window& ClearState(unsigned int flag) { + Window& ClearState(unsigned int flag) { ::ClearWindowState(flag); return *this; } @@ -160,7 +160,7 @@ class Window { /** * Clear window with given color. */ - inline Window& ClearBackground(const ::Color& color = BLACK) { + Window& ClearBackground(const ::Color& color = BLACK) { ::ClearBackground(color); return *this; } @@ -168,7 +168,7 @@ class Window { /** * Toggle window state: fullscreen/windowed */ - inline Window& ToggleFullscreen() { + Window& ToggleFullscreen() { ::ToggleFullscreen(); return *this; } @@ -176,7 +176,7 @@ class Window { /** * Set whether or not the application should be fullscreen. */ - inline Window& SetFullscreen(bool fullscreen) { + Window& SetFullscreen(bool fullscreen) { if (fullscreen) { if (!IsFullscreen()) { ToggleFullscreen(); @@ -193,7 +193,7 @@ class Window { /** * Toggle window state: borderless/windowed */ - inline Window& ToggleBorderless() { + Window& ToggleBorderless() { ::ToggleBorderlessWindowed(); return *this; } @@ -201,7 +201,7 @@ class Window { /** * Set window state: maximized, if resizable (only PLATFORM_DESKTOP) */ - inline Window& Maximize() { + Window& Maximize() { ::MaximizeWindow(); return *this; } @@ -209,7 +209,7 @@ class Window { /** * Set window state: minimized, if resizable (only PLATFORM_DESKTOP) */ - inline Window& Minimize() { + Window& Minimize() { ::MinimizeWindow(); return *this; } @@ -217,7 +217,7 @@ class Window { /** * Set window state: not minimized/maximized (only PLATFORM_DESKTOP) */ - inline Window& Restore() { + Window& Restore() { ::RestoreWindow(); return *this; } @@ -225,7 +225,7 @@ class Window { /** * Set icon for window */ - inline Window& SetIcon(const ::Image& image) { + Window& SetIcon(const ::Image& image) { ::SetWindowIcon(image); return *this; } @@ -233,7 +233,7 @@ class Window { /** * Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) */ - inline Window& SetIcons(Image* images, int count) { + Window& SetIcons(Image* images, int count) { ::SetWindowIcons(images, count); return *this; } @@ -241,7 +241,7 @@ class Window { /** * Set title for window */ - inline Window& SetTitle(const std::string& title) { + Window& SetTitle(const std::string& title) { ::SetWindowTitle(title.c_str()); return *this; } @@ -249,7 +249,7 @@ class Window { /** * Set window position on screen */ - inline Window& SetPosition(int x, int y) { + Window& SetPosition(int x, int y) { ::SetWindowPosition(x, y); return *this; } @@ -257,14 +257,14 @@ class Window { /** * Set window position on screen */ - inline Window& SetPosition(const ::Vector2& position) { + Window& SetPosition(const ::Vector2& position) { return SetPosition(static_cast(position.x), static_cast(position.y)); } /** * Set monitor for the current window */ - inline Window& SetMonitor(int monitor) { + Window& SetMonitor(int monitor) { ::SetWindowMonitor(monitor); return *this; } @@ -272,7 +272,7 @@ class Window { /** * Set window minimum dimensions */ - inline Window& SetMinSize(int width, int height) { + Window& SetMinSize(int width, int height) { ::SetWindowMinSize(width, height); return *this; } @@ -280,7 +280,7 @@ class Window { /** * Set window minimum dimensions */ - inline Window& SetMinSize(const ::Vector2& size) { + Window& SetMinSize(const ::Vector2& size) { ::SetWindowMinSize(static_cast(size.x), static_cast(size.y)); return *this; } @@ -288,7 +288,7 @@ class Window { /** * Set window dimensions */ - inline Window& SetSize(int width, int height) { + Window& SetSize(int width, int height) { ::SetWindowSize(width, height); return *this; } @@ -296,7 +296,7 @@ class Window { /** * Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) */ - inline Window& SetOpacity(float opacity) { + Window& SetOpacity(float opacity) { ::SetWindowOpacity(opacity); return *this; } @@ -304,7 +304,7 @@ class Window { /** * Set window focused (only PLATFORM_DESKTOP) */ - inline Window& SetFocused() { + Window& SetFocused() { ::SetWindowFocused(); return *this; } @@ -312,28 +312,28 @@ class Window { /** * Set window dimensions */ - inline Window& SetSize(const ::Vector2& size) { + Window& SetSize(const ::Vector2& size) { return SetSize(static_cast(size.x), static_cast(size.y)); } /** * Get the screen's width and height. */ - inline Vector2 GetSize() const { + Vector2 GetSize() const { return {static_cast(GetWidth()), static_cast(GetHeight())}; } /** * Get native window handle */ - inline void* GetHandle() const { + void* GetHandle() const { return ::GetWindowHandle(); } /** * Setup canvas (framebuffer) to start drawing */ - inline Window& BeginDrawing() { + Window& BeginDrawing() { ::BeginDrawing(); return *this; } @@ -341,7 +341,7 @@ class Window { /** * End canvas drawing and swap buffers (double buffering) */ - inline Window& EndDrawing() { + Window& EndDrawing() { ::EndDrawing(); return *this; } @@ -349,63 +349,63 @@ class Window { /** * Get current screen width */ - inline int GetWidth() const { + int GetWidth() const { return ::GetScreenWidth(); } /** * Get current screen height */ - inline int GetHeight() const { + int GetHeight() const { return ::GetScreenHeight(); } /** * Get current render width (it considers HiDPI) */ - inline int GetRenderWidth() const { + int GetRenderWidth() const { return ::GetRenderWidth(); } /** * Get current render height (it considers HiDPI) */ - inline int GetRenderHeight() const { + int GetRenderHeight() const { return ::GetRenderHeight(); } /** * Get window position XY on monitor */ - inline Vector2 GetPosition() const { + Vector2 GetPosition() const { return ::GetWindowPosition(); } /** * Get window scale DPI factor */ - inline Vector2 GetScaleDPI() const { + Vector2 GetScaleDPI() const { return ::GetWindowScaleDPI(); } /** * Set clipboard text content */ - inline void SetClipboardText(const std::string& text) { + void SetClipboardText(const std::string& text) { ::SetClipboardText(text.c_str()); } /** * Get clipboard text content */ - inline const std::string GetClipboardText() { + const std::string GetClipboardText() { return ::GetClipboardText(); } /** * Set target FPS (maximum) */ - inline Window& SetTargetFPS(int fps) { + Window& SetTargetFPS(int fps) { ::SetTargetFPS(fps); return *this; } @@ -413,35 +413,35 @@ class Window { /** * Returns current FPS */ - inline int GetFPS() const { + int GetFPS() const { return ::GetFPS(); } /** * Draw current FPS */ - inline void DrawFPS(int posX = 10, int posY = 10) const { + void DrawFPS(int posX = 10, int posY = 10) const { ::DrawFPS(posX, posY); } /** * Returns time in seconds for last frame drawn */ - inline float GetFrameTime() const { + float GetFrameTime() const { return ::GetFrameTime(); } /** * Returns elapsed time in seconds since InitWindow() */ - inline double GetTime() const { + double GetTime() const { return ::GetTime(); } /** * Check if window has been initialized successfully */ - inline static bool IsReady() { + static bool IsReady() { return ::IsWindowReady(); } @@ -452,7 +452,7 @@ class Window { * * @see ::SetConfigFlags */ - inline void SetConfigFlags(unsigned int flags) { + void SetConfigFlags(unsigned int flags) { ::SetConfigFlags(flags); } }; diff --git a/include/raylib-cpp-utils.hpp b/include/raylib-cpp-utils.hpp index 27116848..4eee8329 100644 --- a/include/raylib-cpp-utils.hpp +++ b/include/raylib-cpp-utils.hpp @@ -14,9 +14,9 @@ */ #define GETTERSETTER(type, method, name) \ /** Retrieves the name value for the object. @return The name value of the object. */ \ - inline type Get##method() const { return name; } \ + type Get##method() const { return name; } \ /** Sets the name value for the object. @param value The value of which to set name to. */ \ - inline void Set##method(type value) { name = value; } + void Set##method(type value) { name = value; } #endif #endif // RAYLIB_CPP_INCLUDE_RAYLIB_CPP_UTILS_HPP_