Skip to content

OsouzaTI/mercury-3d-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OSEngine

Dependencies

imgui.

imgui_sdl.

upng.

SDL_image.

SDL_ttf.

SDL2.

Images

Cube with texture

Multiples meshes

Usage

First import the renderer.h library, then inherit that class in your master class

Example

#include "renderer.h"

class Example : public OSRenderer
{
public:
	Example() {};
	~Example() {};

	void engine_main() override;
	void process_input() override;
	void update() override;
	void render() override;

private:

};

void Example::engine_main()
{
	create_window("Example window", 400, 400, NONGUI);
	// default camera
	create_camera(
		{ 0, 0, 0 }, // position
		{ 0, 0 ,1 }, //direction
		0.0f, // yaw rotation
		60.0f, // FOV
		1.0f, // NEAR
		100.0f // FAR
	);

}

void Example::process_input()
{
	read_event();
	switch (keyboard_event_type()) {
	case OS_KEYBOARD_TYPE::QUIT: game_loop = false;
	default: break;
	}
}

void Example::update()
{
	frame_rate_control();
}

void Example::render() {
	// code
	draw.draw_circle(10, 10, 100, C_RED);
}

int main(int argc, char* argv[]) {
	Example example;
	example.run();
	return 0;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published