https://github.com/hopson97/opengl-text
Tests to get an text rendering using modern OpenGL and using sf::Font as the font handler
https://github.com/hopson97/opengl-text
Last synced: 10 months ago
JSON representation
Tests to get an text rendering using modern OpenGL and using sf::Font as the font handler
- Host: GitHub
- URL: https://github.com/hopson97/opengl-text
- Owner: Hopson97
- Created: 2020-01-28T19:15:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-29T23:42:07.000Z (over 6 years ago)
- Last Synced: 2025-01-17T13:48:29.607Z (over 1 year ago)
- Language: C++
- Size: 787 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenGL Text Testing
Testing to see if I can get opengl text rendering using sfml as a font loader.
## Progress [(Album)](https://imgur.com/a/HulQLra)
Text loaded to a texture:

[Commit](https://github.com/Hopson97/opengl-text/tree/1217595952a72f73bd78b04eda9d59735d56876c)
___
Text rendered as a single vertex array, one character per quad.

[Commit](https://github.com/Hopson97/opengl-text/tree/e1a90a02a6b6a542813535ff324d2886910b04af)
____
Text as row of text, except the image texture seems to be upsidedown flipped.

[Commit](https://github.com/Hopson97/opengl-text/commit/5813c3f56e0b1a9246035c2a2f367a5d224d7969)
____
Finally worked out texture coords except a lot of characters were positioned incorrectly

Punctuation especially:

So added a bunch of hacky edge cases :/
Kinda works but idk prob is a better way:

## Building and Running
### Libraries
SFML and GLM are required.
These can be installed from your project manager. For example, on Debian/ Ubuntu:
```sh
sudo apt install libsfml-dev libglm-dev
```
If this is not possible (eg windows), you can install these manually from their respective websites:
https://www.sfml-dev.org/download.php
https://github.com/g-truc/glm/tags
### Linux
To build, at the root of the project:
```sh
sh scripts/build.sh
```
To run, at the root of the project:
```sh
sh scripts/run.sh
```
To build and run in release mode, simply add the `release` suffix:
```sh
sh scripts/build.sh release
sh scripts/run.sh release
```
You can also create a deployable build (that can be sent) by doing:
```sh
sh scripts/deploy.sh
```