Skip to content

Quark-Engine/QuarkCore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuarkCore

An OpenGL rendering library built to make lighting easy for the Quark Engine — and ~1.5x faster than Raylib.

C++17 OpenGL License


Quick Start

Requirements

  • C++17 or later
  • OpenGL 3.3+
  • CMake 3.16+

Installation

git clone https://github.com/Quark-Engine/QuarkCore.git
cd QuarkCore
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

Then link against QuarkCore in your CMakeLists.txt:

target_link_libraries(your_target PRIVATE QuarkCore)

Usage

#include "QuarkCore/QuarkCore.hpp"

int main() {
    qc::InitWindow(1280, 720, "Hello World");
    qc::SetTargetFPS(60);

    while (!qc::WindowShouldClose()) {
        qc::BeginDrawing();
        qc::ClearBackground(qc::Color{20, 24, 32, 255});

        qc::DrawText("Hello, World!", 360, 340, 32, qc::WHITE);

        qc::EndDrawing();
    }

    qc::CloseWindow();
    return 0;
}

API Overview

Category Functions
Window InitWindow, CloseWindow, WindowShouldClose, SetTargetFPS, SetWindowMinimumSize
Drawing BeginDrawing, EndDrawing, ClearBackground
2D BeginMode2D, EndMode2D, DrawRectangle, DrawCircle, DrawGrid, DrawTexture, DrawTexturePro
3D BeginMode3D, EndMode3D, DrawPlane, DrawCube
Textures LoadRenderTexture, UnloadRenderTexture, GenCheckerTexture, UnloadTexture
Shaders LoadShaderFromMemory, GetShaderLocation, SetShaderValue, BeginShaderMode, EndShaderMode, UnloadShader
Text DrawText, DrawTextEx, MeasureText, MeasureTextEx, GetDefaultFont, TextFormat
Input IsKeyPressed, IsKeyDown, PollEvent
Logging TraceLog, SetLogLevel
Screen GetScreenWidth, GetScreenHeight, GetFPS, GetDeltaTime, GetCurrentMonitorRefreshRate

Built-in Shader Constants

QuarkCore exposes its default vertex shader source so you can pair it with any custom fragment shader:

qc::LoadShaderFromMemory(qc::kVertexShaderSource, myFragmentShader);

Examples

The examples/ directory contains demos for:

  • sandbox.cpp — window setup, 2D/3D cameras, render textures, text rendering
  • shaders.cpp — chromatic aberration, pixelation, vignette, scanlines with live parameter tuning

Made for the Quark Engine

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors