https://github.com/genericptr/glcanvas
OpenGL drawing library for Free Pascal
https://github.com/genericptr/glcanvas
Last synced: 10 months ago
JSON representation
OpenGL drawing library for Free Pascal
- Host: GitHub
- URL: https://github.com/genericptr/glcanvas
- Owner: genericptr
- Created: 2019-10-02T13:27:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T00:52:09.000Z (about 3 years ago)
- Last Synced: 2025-05-05T16:54:26.126Z (about 1 year ago)
- Language: Pascal
- Homepage:
- Size: 10.8 MB
- Stars: 15
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GLCanvas - Minimalistic rendering library
GLCanvas provides a minimalistic rendering API in the same vein as [raylib](https://www.raylib.com) or [libGDX](https://libgdx.badlogicgames.com).
A simple program with GLCanvas:
```pascal
program Test;
uses
CThreads, GLCanvas;
const
window_size_width = 600;
window_size_height = 600;
var
texture: TTexture;
begin
SetupCanvas(window_size_width, window_size_height);
texture := TTexture.Create('deer.png');
while IsRunning do
begin
ClearBackground;
DrawTexture(texture, RectMake(50, 50, texture.GetSize));
SwapBuffers;
end;
QuitApp;
end.
```
### Features:
- Flat procedural API
- Standard vector types and matrix math
- Texture loading (only supports PNG format currently)
- Bitmap and Freetype fonts
- Shaders (optional)
- Frame buffers (optional)
- GLUI for many common UI elements like windows, buttons etc...
### Platforms:
- [GLPT](https://github.com/genericptr/GLPT) enable using `-dPLATFORM_GLPT` (GLPT is the default platform)
- [SDL](https://github.com/libsdl-org/SDL) enable using `-dPLATFORM_SDL`
### Installing on Windows:
- Download and install the latest release of SDL2 for mingw. For example at the time of writing this `SDL2-devel-2.26.3-mingw.zip` is most recent. See https://github.com/libsdl-org/SDL/releases. Copy the `SDL2.dll` from `\SDL2-2.24.1\i686-w64-mingw32\bin` into the directory which contains the compiled executable (Use i686 for if you're using the `i386-win32` 32-bit compiler).
- Download FreeType libraries from https://github.com/ubawurinna/freetype-windows-binaries. Copy `/release dll/win32/freetype.dll` into the directory which contains the compiled executable.