Skip to content

IdkWhatToWriteHereOhManItWasAlreadyUsed/OpenGLSomethingFrameDisplayerEVO

Repository files navigation

OpenGLSomethingFrameDisplayerEVO

A Beautiful and Modern 3D Display for RGB Data

Linux macOS Windows OpenGL License

๐ŸŒŸ About

OpenGLSomethingFrameDisplayerEVO is a graphical API for displaying RGB data in a Minecraft-like world. Currently, only chunk mode is available, but additional display modes will be added in the future.

๐Ÿ”ฎ RGBA support coming soon!

๐Ÿ“‹ Requirements

Platforms

  • โœ… Linux (fully supported)
  • โœ… macOS (fully supported)
  • โณ Windows (coming soon)

Dependencies

  • OpenGL (scene rendering)
  • GLFW (window creation)

๐Ÿš€ Quick Start

1. Clone the Repository

git clone https://github.com/IdkWhatToWriteHereOhManItWasAlreadyUsed/OpenGLSomethingFrameDisplayerEVO.git

2. CMake Integration

Add to your CMakeLists.txt:

# Add subdirectory
add_subdirectory(OpenGLSomethingFrameDisplayerEVO)

# Link the library
target_link_libraries(your_project_name 
    PRIVATE 
    OpenGLSomethingFrameDisplayerEVO
)

# Copy resources
copy_opengl_resources(${PROJECT_NAME})

3. Build the Project

mkdir build && cd build
cmake ..
make -j$(nproc)

๐Ÿ“– API Usage

Include the Header

#include "OpenGLSomethingFrameDisplayerEVO.h"

Basic Example

// Create a global instance (important for multi-threading)
OpenGLSomethingFrameDisplayerEVO::OpenGLSomethingFrameDisplayerEVO displayer;

// Set video size BEFORE initialization
displayer.SetVideoSize(480, 360);

// Initialize the engine (window size: 1280x720)
displayer.InitialiseGame(1280, 720);

// Start the engine
displayer.Start();

// Display a frame from another thread
std::vector<uint8_t> frame_data(width * height * 3); // RGB data
displayer.DisplayFrame(frame_data.data());

โš™๏ธ Advanced Usage

Thread Management

// Specify number of threads for the engine
// Consider your application's total thread usage
displayer.SetThreadCount(4);

Thread Synchronization

// Thread A: Set video size
displayer.SetVideoSize(640, 480);

// Initialisation Thread : Wait for video size to be set
displayer.WaitForSetVideoSize();

// Thread B: Wait for engine initialization
displayer.WaitForGameInit();

macOS Specifics

// IMPORTANT: On macOS, initialization and running must
// occur in the main thread of the process
int main() {
    // Initialization and start MUST be here
    displayer.InitialiseGame(800, 600);
    displayer.Start();
    return 0;
}

๐ŸŽฎ Engine Window Controls

Basic Controls

  1. Take control: Hover over window and press Left Ctrl
  2. Movement: W A S D
  3. Camera rotation: Mouse movement
  4. Exit: Esc (with cursor captured) or window close button

Scene Adjustment

  • Unlock mouse (Left Ctrl)
  • Use ImGui panel for real-time scene adjustments
  • Modify lighting, textures, and other parameters

โš ๏ธ Important Notes

Limitations

  • โŒ Video resizing not supported (and probably never will be)
  • ๐Ÿ“ Recommended video size: up to 480ร—360
  • ๐Ÿ”ง Not thread-safe: DisplayFrame can be called from any thread, but not concurrently

Performance Recommendations

  • Use small video resolutions (up to 480ร—360)
  • Optimally distribute threads between your app and the engine
  • Increase engine thread count for higher resolutions

๐ŸŽฏ Usage Examples

Video Player (badPlayerMax)

Full-featured video player using FFmpeg and OpenGL: GitHub Repository

3D Model Visualizer (with SDL2)

GitHub Repository

Resource Structure

build/
โ”œโ”€โ”€ your_app
โ”œโ”€โ”€ res/
โ”‚   โ”œโ”€โ”€ shaders/
โ”‚   โ”œโ”€โ”€ textures/
โ”‚   โ””โ”€โ”€ blocks/

๐Ÿ“„ License

This project is licensed under the MIT License. See LICENSE for details.


Enjoy! ๐Ÿš€

For questions or suggestions, please create an issue in the project repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages