https://github.com/bl33h/computergraphicstemplatefiles
A program that implements a C++ framebuffer for color manipulation and display on a virtual screen.
https://github.com/bl33h/computergraphicstemplatefiles
cmake colors computer-graphics framebuffer framebuffers gcc template
Last synced: about 2 months ago
JSON representation
A program that implements a C++ framebuffer for color manipulation and display on a virtual screen.
- Host: GitHub
- URL: https://github.com/bl33h/computergraphicstemplatefiles
- Owner: bl33h
- Created: 2023-07-11T20:11:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-21T06:54:24.000Z (over 2 years ago)
- Last Synced: 2025-03-14T22:45:51.459Z (9 months ago)
- Topics: cmake, colors, computer-graphics, framebuffer, framebuffers, gcc, template
- Language: C++
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# computerGraphicsTemplateFiles
This project contains the source code for a framebuffer implementation in C++. It allows you to manipulate and display colors on a virtual screen. It also provides functionality to clear the screen, set the current color, and store color values in a vector. This repository was made to use as a template for the different activities in the Computer Graphics course.
Files •
Features •
How To Use
## Files
- src: the file that implements de solution.
- CMakeLists.txt: the CMake configuration.
## Features
The main features of the application include:
- Framebuffer: The framebuffer.h file provides a framebuffer vector that represents the virtual screen. It is a 1-dimensional vector of Color objects, with dimensions defined by the SCREEN_WIDTH and SCREEN_HEIGHT constants.
- Color Manipulation: The colors.h file defines the Color struct, which represents an RGB color. It provides functionality to create colors, perform arithmetic operations (addition and multiplication), and clamp color values within a specified range.
- Clearing the Screen: The clear() function in framebuffer.h clears the framebuffer by filling it with the clearColor value. It utilizes the std::fill algorithm to efficiently set all elements of the vector.
## How To Use
To clone and run this application, you'll need [Git](https://git-scm.com), [CMake](https://cmake.org/download/), [Chocolatey](https://docs.chocolatey.org/en-us/choco/setup) (in order to execute Make) and a [C++ compiler](https://www.fdi.ucm.es/profesor/luis/fp/devtools/mingw.html) installed on your computer. From your command line:
```bash
# Clone this repository
$ git clone https://github.com/bl33h/computerGraphicsTemplateFiles
# Open the folder
$ cd src
# Run the app
$ g++ main.cpp -o framebuffer
$ ./framebuffer
# Build the app using CMake
$ cmake -G "Unix Makefiles" -S . -B build
$ cd build/
$ make
$ GAME.exe
```