Skip to content

Mikrikle/PixelEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PixelEngine

Engine for drawing pixel-based 2D graphics to the full window. Based on OpenGL 3.3+ and GLFW.

Designed for cellular automata, drawing, and simple games.

image

How to use

You should see this window

image

base code example

#include <iostream>
#include "./shaders/shader.h"
#include "./includes/PixelEngine.h"
int px::windowWidth = 800;
int px::windowHeight = 800;
Window window(px::windowWidth, px::windowHeight, "App_name");
Shader sh("../../src/shaders/vertexShader.txt", "../../src/shaders/fragmentShader.txt");
Shader* px::DefaultShader = &sh;

class App : public px::PxBaseApp
{
public:
	App()
	{
		manager.init({ &rectangle });
		grid.init(1, 1, { {&rectangle} });
		init();
	}

	void objectsEvents()
	{
	}

	void objectsSetting()
	{
		rectangle.setUnderTextureColor(glm::mat2x3(0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f));
	}

private:
	px::PxRectangle rectangle;
};

int main()
{
	App TestApp;
	window.enable_blend();
	while (!window.isShouldClose())
	{
		window.clearWindow(0.1f, 0.1f, 0.1f);
		TestApp.run();
		window.swapBuffers();
		window.poolEvents();
	}
	return 0;
}

About

OpenGL 2D engine

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published