开发者

Looking for example using FTGL and Qt (OpenGL)

开发者 https://www.devze.com 2023-03-07 19:20 出处:网络
i need to do simple application that render开发者_运维知识库 3d fonts to image. the recommended lib is FTGL , how can i combine it with 3dQt?OpenGL doesn\'t care whether you are using Qt, glut, SDL o

i need to do simple application that render开发者_运维知识库 3d fonts to image. the recommended lib is FTGL , how can i combine it with 3dQt?


OpenGL doesn't care whether you are using Qt, glut, SDL or anything else. Therefore, find an OpenGL example for Qt, then find an example using FTGL library, and combine the two by starting from the Qt OpenGL example, and add the code to initialize FTGL library and try to render some text.

PS Unfortunately, I do not have such example, but it should be straight forward.


OpenGL does care whether you are using Qt, because OpenGL now is a giant state machine, behavior dependent on how context was initialized - Qt obscures it by their objects behavior, because it uses OpenGL for rendering UI. So far I was unable to find any example of use, andy attempt to port glut example (from ftgl itself) to Qt didn't yield font rendering. I suspect that Qt interferes with freetype use (which is used both in QT and in ftgl). Cons from using Qt's rendering subroutine for text: 1) it renders in 2d coords of widget, not in MVP coords 2) it pushes and resets projection and transform matrices with every call of that subroutine, and it uses OpenGl 1.3 calls

0

精彩评论

暂无评论...
验证码 换一张
取 消