PDA

View Full Version : Sign indicator on OpenGL



kordal
24-01-2011, 08:46 PM
Hi all!

I offer realization of the sign indicator on OpenGL. As such example an electronic clock can serve. The sign indicator is able to display all figures and some letters of the English alphabet. Possibilities: an inclination of symbols, scaling, a color choice. All is very simple, doesn't use textures and fonts.

Screen:
http://delphiprog.it-fg.ru/data/upimages/OpenGL/OGLDigit.jpg

Download link: Sample Digit (src) (http://delphiprog.it-fg.ru/dlcount.php?id=1295749106&url=Hx5VUEVQHlVeRl9dXlBVQh5eQVRfVl0eYlBcQV1UdVhWWE VuQkNSH0tYQQ)
Download link: Sample Digit (bin) (http://delphiprog.it-fg.ru/dlcount.php?id=1295749106&url=Hx5VUEVQHlVeRl9dXlBVQh5eQVRfVl0eYlBcQV1UdVhWWE VuU1hfH0tYQQ)

Have fun.

farcodev
25-01-2011, 10:23 PM
Interesting, thanks for the sharing :)

User137
26-01-2011, 05:35 PM
I just noticed in code and source that the scaling gives a little issues. Using glScale have some unwanted effects, like in my case the small fps text has 2 pixel wide top part where middle and lower parts are 1 pixel. It also attaches the parts tight together in small size, when parts have the proper gap in larger size. It could also use vertex arrays for speed.

Is it just me or would you create the middle part of 6 vertex triangle_strip instead of 2 separately handled quads? :)

kordal
29-01-2011, 08:01 AM
The small text should be set property "width" and "height". Property "Scale" use for the size more than 10-15.
The geometry can be drawn quads, I do not argue. Vertex array didn't begin to use, this complication of a code :) When wrote the sign indicator, there was an interest to look that will turn out as a result.
If will make changes, please share a source code :)


Is it just me or would you create the middle part of 6 vertex triangle_strip instead of 2 separately handled quads?
As all geometry is drawn by triangles, it was necessary to draw an average part from 4 triangles for use glBegin, glEnd 1 time. If to draw quads it is possible to make two separate squares with the general party.

Rahakasvi
01-02-2011, 10:51 AM
Thanks for this! Very interesting. Would this be faster than drawing with textured quads? Of course there is memory usage advantage.

kordal
01-02-2011, 08:44 PM
Please! Use on health. When wrote, about textures didn't think. And should work faster :)