o
odin.langpkg.dev
packages / binding / RGFW-Odin

RGFW-Odin

0.50binding

RGFW bindings for Odin

CC0-1.0 · updated 1 day ago

RGFW-Odin

THE RGFW Logo

Build statuses

workflow workflow windows workflow windows

About

Odin bindings for RGFW,

Backends supported includes, X11, Cocoa and Windows, Web has not been tested and Wayland support has not yet been included.

Currently the graphics backend supports OpenGL, EGL, Vulkan, Metal, DirectX and buffer rendering, WebGPU helpers are not included.

building

To build the Odin binding simple run make build-RGFW you can also run make to build and then run an example program or make debug to build from scratch then run an example program.

examples

examples

basic

A basic example can be found in basic.odin, it includes a basic OpenGL example of just about all of RGFW's functionalities.

basic buffer

A basic example can be found in basic-buffer.odin, it includes a basic OpenGL example of buffer rendering with odin

a very simple example

package main

import "core:fmt"
import "RGFW"
import gl "vendor:OpenGL"

main :: proc() {
    RGFW.init("example", .initOpenGL);
    defer RGFW.deinit();

	window := RGFW.createWindow("window", 200, 200, 200, 200, .windowCenter | .windowOpenGL);
	RGFW.window_makeCurrentContext_OpenGL(window);

	gl.load_up_to(3, 3, RGFW.setProcAddress_OpenGL)

	for (!RGFW.window_shouldClose(window)) {
		RGFW.pollEvents();

		gl.Clear(gl.COLOR_BUFFER_BIT)
		gl.ClearColor(0, 0, 0, 1.0)

		RGFW.window_swapBuffers_OpenGL(window);
	}


	RGFW.window_close(window);
}

This can be compiled with

odin run [file].odin -file

Contacts

Documentation

More information about RGFW can be found on the RGFW repo

There is a lot of in-header-documentation, but more documentation can be found here

If you wish to build the documentation yourself, there is also a Doxygen file attached.