47 virtual void InitWindow(
int width,
int height,
const char *title) = 0;
149 virtual void DrawRect(
int x,
int y,
int width,
int height,
unsigned int color) = 0;
159 virtual void DrawRectFilled(
int x,
int y,
int width,
int height,
unsigned int color) = 0;
168 virtual void DrawCircle(
int x,
int y,
int radius,
unsigned int color) = 0;
187 virtual int LoadFont(
const char *filepath,
int size) = 0;
204 virtual void DrawText(
int fontHandle,
const char *text,
int x,
int y,
int fontSize,
205 unsigned int color) = 0;
222 virtual int LoadTexture(
const char *textureName,
const char *filepath) = 0;
233 int height,
int format) = 0;
240 virtual void UpdateTexture(
const char *textureName,
const void *pixels) = 0;
255 virtual void DrawTexture(
const char *textureName,
int x,
int y,
unsigned int tint) = 0;
270 virtual void DrawTextureEx(
const char *textureName,
int srcX,
int srcY,
int srcW,
int srcH,
271 float destX,
float destY,
float rotation,
float scale,
272 unsigned int tint) = 0;
281 virtual bool GetTextureSize(
const char *textureName,
int &width,
int &height)
const = 0;
296 virtual void DrawTexturePro(
const char *textureName,
int srcX,
int srcY,
int srcW,
int srcH,
297 float destX,
float destY,
float destW,
float destH,
298 unsigned int tint) = 0;
421 virtual void DrawRectangle(
int x,
int y,
int width,
int height,
unsigned int color) = 0;
441 virtual void DrawText(
const char *text,
int x,
int y,
int fontSize,
unsigned int color) = 0;
493 virtual bool LoadSound(
const char *soundName,
const char *filepath) = 0;
Abstract interface for graphics rendering operations.
virtual void SetWindowTitle(const char *title)=0
Change the window title.
virtual bool IsMouseButtonDown(int button) const =0
Check if a mouse button is currently being held down.
virtual bool LoadSound(const char *soundName, const char *filepath)=0
Load a sound from file.
virtual void DrawText(const char *text, int x, int y, int fontSize, unsigned int color)=0
Draw text using default font (simplified version)
virtual bool IsGamepadButtonDown(int gamepad, int button) const =0
Check if a gamepad button is currently held down.
virtual void SetTargetFPS(int fps)=0
Set the target frames per second for rendering.
virtual void PlaySound(const char *soundName)=0
Play a loaded sound.
virtual bool IsKeyPressed(int key) const =0
Check if a key was pressed (triggered once when key goes down)
virtual int GetWindowHeight() const =0
Get current window height in pixels.
virtual void ClearWindow()=0
Clear the window with the current clear color.
virtual void UnloadSound(const char *soundName)=0
Unload a previously loaded sound.
virtual void DrawCircleFilled(int x, int y, int radius, unsigned int color)=0
Draw a filled circle.
virtual void UpdateTexture(const char *textureName, const void *pixels)=0
Update an existing texture with new pixel data.
virtual void DrawRectFilled(int x, int y, int width, int height, unsigned int color)=0
Draw a filled rectangle.
virtual bool IsAudioDeviceReady() const =0
Check if audio device is ready.
virtual void DisplayWindow()=0
Display the current frame to the window (end drawing and swap buffers)
virtual void DrawText(int fontHandle, const char *text, int x, int y, int fontSize, unsigned int color)=0
Draw text using a loaded font.
virtual void GetMousePosition(float &x, float &y) const =0
Get the current mouse cursor position.
virtual bool IsWindowOpen() const =0
Check if the window is still open.
virtual int CreateTextureFromMemory(const char *textureName, const void *pixels, int width, int height, int format)=0
Create a texture from raw pixel data in memory.
virtual int GetMouseX() const =0
Get the current X position of the mouse cursor.
virtual void CloseAudioDevice()=0
Close the audio device and cleanup audio resources.
virtual bool IsKeyReleased(int key) const =0
Check if a key was released (triggered once when key goes up)
virtual void SetClearColor(unsigned int color)=0
Set the background clear color.
virtual int GetWindowWidth() const =0
Get current window width in pixels.
virtual void DrawTexturePro(const char *textureName, int srcX, int srcY, int srcW, int srcH, float destX, float destY, float destW, float destH, unsigned int tint)=0
Draw a texture with separate width/height scaling (for non-uniform scaling)
virtual void InitWindow(int width, int height, const char *title)=0
Initialize the graphics window.
virtual bool IsSoundPlaying(const char *soundName) const =0
Check if a sound is currently playing.
virtual void StartDrawing()=0
Begin drawing frame (setup canvas for drawing operations)
virtual void SetColorblindFilter(ColorblindFilterType filter)=0
Set the colorblind filter type.
virtual void DrawRect(int x, int y, int width, int height, unsigned int color)=0
Draw a rectangle outline.
virtual void ToggleFullScreen()=0
Toggle between fullscreen and windowed mode.
virtual void UnloadTexture(const char *textureName)=0
Unload a previously loaded texture.
virtual void DrawTexture(const char *textureName, int x, int y, unsigned int tint)=0
Draw a texture at the specified position.
virtual void SetWindowSize(int width, int height)=0
Resize the window.
virtual bool IsGamepadAvailable(int gamepad) const =0
Check if a gamepad is available/connected.
virtual void CloseWindow()=0
Close the graphics window and cleanup resources.
virtual bool IsGamepadButtonPressed(int gamepad, int button) const =0
Check if a gamepad button was pressed this frame.
virtual int GetScreenHeight() const =0
Get the screen height (same as window height)
virtual int LoadTexture(const char *textureName, const char *filepath)=0
Load a texture from an image file.
virtual void DrawTextureEx(const char *textureName, int srcX, int srcY, int srcW, int srcH, float destX, float destY, float rotation, float scale, unsigned int tint)=0
Draw a texture with advanced parameters (rotation, scale, source rectangle)
virtual void BeginColorblindCapture()=0
Begin capturing frame for colorblind filter processing.
virtual float GetTime() const =0
Get elapsed time since initialization.
virtual int GetMouseY() const =0
Get the current Y position of the mouse cursor.
virtual int LoadFont(const char *filepath, int size)=0
Load a font from file.
virtual int GetFontHeight(int fontHandle, int fontSize)=0
Get the height of a font at a given size.
virtual float GetGamepadAxisMovement(int gamepad, int axis) const =0
Get gamepad axis value (for analog sticks and triggers)
virtual void EndColorblindCapture()=0
End capturing and apply the colorblind filter.
virtual int GetCharPressed() const =0
Get the next character from the keyboard input queue.
virtual void SetSoundVolume(const char *soundName, float volume)=0
Set volume for a specific sound.
virtual ColorblindFilterType GetColorblindFilter() const =0
Get the current colorblind filter type.
virtual ~IGraphics()=default
Virtual destructor.
virtual bool IsMouseButtonPressed(int button) const =0
Check if a mouse button was pressed (triggered once when button goes down)
virtual void DrawRectangleLines(int x, int y, int width, int height, unsigned int color)=0
Draw a rectangle outline (alias for DrawRect)
virtual void UnloadFont(int fontHandle)=0
Unload a previously loaded font.
virtual float GetDeltaTime() const =0
Get the time elapsed for the last frame.
virtual bool WindowShouldClose() const =0
Check if the window should close.
virtual bool IsKeyDown(int key) const =0
Check if a key is currently being held down.
virtual void InitAudioDevice()=0
Initialize the audio device.
virtual int GetScreenWidth() const =0
Get the screen width (same as window width)
virtual void TakeScreenshot(const char *filepath)=0
Capture the current screen and save it to a file.
virtual void DrawCircle(int x, int y, int radius, unsigned int color)=0
Draw a circle outline.
virtual void DrawRectangle(int x, int y, int width, int height, unsigned int color)=0
Draw a filled rectangle (alias for DrawRectFilled)
virtual bool GetTextureSize(const char *textureName, int &width, int &height) const =0
Get the dimensions of a loaded texture.
ColorblindFilterType
Colorblind filter types for accessibility.
@ DEUTERANOPIA
Green-blind (reduced green sensitivity)
@ PROTANOPIA
Red-blind (reduced red sensitivity)
@ MONOCHROMACY
Complete color blindness (grayscale)
@ TRITANOPIA
Blue-blind (reduced blue sensitivity)