Graphics Library Framework for OpenGL
GLFW
Pascal bindings that allow you to use GLFW and other useful C libraries with Delphi.
Included
- GLFW (https://github.com/glfw/glfw)
- enet (https://github.com/lsalzman/enet)
- miniaudio (https://github.com/mackron/miniaudio)
- minizip (https://github.com/madler/zlib)
- physfs (https://github.com/icculus/physfs)
- pl_mpeg (https://github.com/phoboslab/pl_mpeg)
- Nuklear (https://github.com/Immediate-Mode-UI/Nuklear)
Minimum Requirements
- Windows 10+ (64 bits)
- Delphi Community Edition (Win64 platform only)
Usage
You simply add GLFW
to your uses section and everything will be linked in your executable, ready for use with no DLLs to maintain. You will have direct access to all the aforementioned libraries.
uses
System.SysUtils,
GLFW,
GLFW.Glad;
begin
var Window: PGLFWwindow;
// Initialize the library
if glfwInit() = GLFW_FALSE then
Exit;
// Create a windowed mode window and its OpenGL context
Window := glfwCreateWindow(640, 480, 'Hello World', nil, nil);
if (Window = nil) then
begin
glfwTerminate;
Exit;
end;
// Make the window's context current
glfwMakeContextCurrent(Window);
// Load OpenGL
gladLoadGL(TLoadProc(glfwGetProcAddress));
// Loop until the user closes the window
while glfwWindowShouldClose(Window) = GLFW_FALSE do
begin
// Render here
glClear(GL_COLOR_BUFFER_BIT);
// Clear window
glClearColor(1.0/30.0, 1.0/31.0, 1.0/30.0, 1.0/1.0);
// Swap front and back buffers
glfwSwapBuffers(Window);
// Poll for and process events
glfwPollEvents;
end;
glfwDestroyWindow(Window);
glfwTerminate;
end.
Support
Made with