Code Monkey home page Code Monkey logo

furbs's Introduction

Furbs

A Odin library for games, currently under construction not ready for production.

Furbs library collection aims to provide all the necessities for shipping 3D/2D indie games.

The libary collection current holds the following capabilities:
-Utils (used internally)
-Render, used for opening a windows and rending OpenGL 3.3 to 4.6, this might in the furture support 3.0, OpenGL ES 2/3
-GUI library
-Networking library
-Sound library (comming)
-Partical system library (comming)

It is heavily inspired by Raylib with a greater emphasis om preformence while still being easy to use.

Here is how you would open draw a few 2D shapes with the render library (more examples in "exampels")

import "path/render" //or replace "path"

main :: proc {
	using render;
	
	window := init_window(600, 400, "Hello world", "res/shaders", culling = false);
	
	my_texture := load_texture_from_file("res/textures/test.png");

	mouse_mode(.normal);
	enable_vsync(false); //disable Vsync
	
	my_rect : [4][2]f32 = {};

	my_camera : Camera2D = {
		position 			= {0,0},			// Camera position
		target_relative 	= {0,0},			// 
		rotation	 		= 0,				// In degrees
		zoom	   			= 1,				//
		far					= 1,
		near 				= -1,
	};
	
	for !should_close(window) {
		begin_frame(window, clear_color = {0.5,0.5,0.5,1});
		begin_mode_2D(my_camera);

		//Draw rects
		draw_shape([4]f32{0, 0, 0.5, 0.5}, rot = 45, texture = my_texture);
		draw_shape([4]f32{-0.5, -0.5, 0.5, 0.5}, color = {1,0,0,1});
		
		//Draw lines
		draw_shape(Circle{1, [2]f32{0,0}}, color = {0,0,1,0.5});

		end_mode_2D(my_camera);
		end_frame(window);
	}
	
	destroy_window(&window);
	fmt.printf("Shutdown succesfull");
}

Tutorials, documentation and more exampels are on the way. Codeveloped by albe194e

Examples are included to do the following: -Drawing 2D
Drawing_a_quad

-Drawing 3D<br />

Drawing_a_quad_3D

-Drawing 2D shapes, transparetcy and textures 3D<br />

Drawing_shapes

-Drawing text<br />

Drawing_text

-Drawing 3D<br />

Drawing_3D

Furbs also include a gui library.
The gui library includes the following elements:
-Rect
-Button
-Checkbox
-Slide_input
-Slider
-Input_field
-Selector
-Slot
-Label

Below is an example with a button:
Skærmbillede 2024-01-01 201929

and here is a little menu:
Skærmbillede 2024-01-01 202136
resizing happens automagicly.
Skærmbillede 2024-01-01 202311
this gui system is suitable for in-game guis. Once can retrive events like: hover, active and triggered.
hover : being true when the elements is hovered over.
active : being trie when the element is currently selected in one way or another, this is element dependent.
triggered : being true when the element recives an 1 time event (like being clicked) also element dependent.

A collection of gui elements are shown below:
Skærmbillede 2024-01-01 202400

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.