Comments (2)
Thanks for reading the tutorial!
Yes, you are right. It is not recommended to use AWT, and I want to remove that dependency (see issue #4). When this is done I will update the tutorial and put the AWT stuff to the appendix section. But right now I hadn't the time to fully implement Fonts with STB, but basically you have to do the following to create a bitmap with the glyphs:
stbtt_PackBegin(packContext, bitmap, imageWidth, imageHeight, 0, 1);
stbtt_PackFontRange(packContext, fontBuffer, 0, fontHeight, 32, chardata);
stbtt_PackEnd(packContext);
After that you can get the glyphs by calling stbtt_GetPackedQuad(chardata, imageWidth, imageHeight, i, xpos, ypos, quad, true);
which will give you a STBTTAlignedQuad
containing the vertex and texture coordinates. This demo may help you implementing it.
I will change the Font class to use STB if I have time, after that I'm thinking of doing some advanced tutorials like using NanoVG or creating audio with OpenAL.
from lwjgl3-tutorial.
I personally would not get rid of this tutorial because some people might want to write their own UI engine and will have this good resource no longer left to learn from.
Also the step of "Swing" could be outsourced to a different program and then have a loader that just converts the texture and a text file into a proper text Loader not requiring Swing or AWT.
from lwjgl3-tutorial.
Related Issues (13)
- typo (propably?) HOT 1
- Add alpha support for textures HOT 2
- How can you resize a texture? HOT 1
- Vulkan Support HOT 1
- "Rendering" tutorial mysteriously isn't working HOT 2
- is there branch build by maven? HOT 1
- Bug in Renderer.drawTextureRegion() with vertices size HOT 1
- Prepare for the official LWJGL 3.0 release HOT 1
- Remove AWT dependency HOT 1
- Setup wiki page snippet doesn't compile (wrong import) HOT 1
- compiling from windows command line HOT 5
- A problem about z value in vertices data HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lwjgl3-tutorial.