Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/strah19/Ember
A graphics framework using SDL2 and OpenGL.
https://github.com/strah19/Ember
Last synced: about 1 month ago
JSON representation
A graphics framework using SDL2 and OpenGL.
- Host: GitHub
- URL: https://github.com/strah19/Ember
- Owner: strah19
- License: mit
- Created: 2020-06-30T19:04:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-13T18:05:38.000Z (almost 3 years ago)
- Last Synced: 2024-08-02T07:20:59.793Z (4 months ago)
- Language: C
- Homepage:
- Size: 6.6 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-game-engine-dev - Ember - Graphics framework using SDL2 and OpenGL. (Libraries / C++)
README
# Ember
Ember is an open source graphics framework for C++.
Ember holds a wide ranges of tools including event handlers, event stacks, file handlers, asset loader, 3d rendering tools and more.
Sample code:
```c++
#include "Application.h"
#include "Renderer.h"
#include "RendererCommands.h"
#include "OrthoCameraController.h"
#include "Geometry.h"
#include "FrameBuffer.h"#define WINDOW_WIDTH 1280
#define WINDOW_HEIGHT 720class Sandbox : public Ember::Application {
public:
void OnCreate() {
Ember::RendererCommand::Init();
Ember::RendererCommand::SetViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);camera = Ember::OrthoCameraController(glm::vec2(WINDOW_WIDTH, WINDOW_HEIGHT));
imgui = new Ember::ImGuiLayer(window, event_handler);
PushLayer(imgui);
}virtual ~Sandbox() { }
void OnUserUpdate(float delta) {
Ember::RendererCommand::Clear();
Ember::RendererCommand::SetClearColor(0.0f, 0.0f, 0.0f, 1.0f);
camera.Update();
renderer->BeginScene(&camera.GetCamera());Ember::Quad::Renderer(renderer);
Ember::Quad::DrawQuad({ 0, 0, 0 }, { 1, 1 }, { 1, 0, 0, 1 });
Ember::Quad::DrawQuad({ 1, 0, 0 }, { 1, 1 }, { 1, 1, 0, 1 });renderer->EndScene();
}void UserDefEvent(Ember::Event& event) {
Ember::EventDispatcher dispatch(&event);
camera.OnEvent(event);
}void OnGuiUpdate() { }
private:
Ember::OrthoCameraController camera;
};int main(int argc, char** argv) {
Sandbox sandbox;
sandbox.Initialize("EmberApp", WINDOW_WIDTH, WINDOW_HEIGHT);sandbox.Run();
return 0;
}```
Simply call this class in `main` with it's initialize and run function and thats it! To use the API, add the desired headers like `Texture.h` and enjoy.
![image not found](https://github.com/strah19/Ember/blob/master/docs/example.png?raw=true)
# Dependencies
All these can actually be found in libs folder (besides the compiler) but here they are anyways: