writing text into pixmap with openGL only
BlitzMax Forums/OpenGL Module/writing text into pixmap with openGL only
| ||
Is it possible to write text into pixmaps using openGL commands only? So far anything I have read indicates that its only possible to write onto the screen buffer. [edit] I am thinking that I might have to use bitmap font and write my own pixel pushing stuff. |
| ||
The only way it would be possible would be to take text that has already been drawn to the OpenGL backbuffer and download it to a pixmap using something like GrabPixmap() or directly calling glReadPixels(). These however will use the CPU as the graphics-card hardware can only access and work with the textures that are stored in video ram. As soon as you try to bridge the gap from the video ram (inside openGL) and the main system memory (in the pixmap), you have to get the CPU involved to move stuff. So no you can't directly use OpenGL to `render to a pixmap`. OpenGL is kind of a closed system. Video memory is also simlar to a CPU cache, whereby stuff has to be in the cache to work fast and if it's not there it has to be transferred from/to main memory with a slower operation. |
| ||
I figured as much, but wasn't sure. I will look into working with bitmap fonts then as I need a way to write text to pixmaps. Thanks for the info. |
| ||
Could you make a window within a pixmap and draw to that window? |
| ||
RenderTargets :) |
| ||
theres opengl pbuffers for that... |
| ||
And how would all of that help him? He wants it in pixmap which will be grab in any way. |
| ||
Its about nine months ago that I needed this. I have in the mean time made a bitmap font module that does what I need, but thanks for posting :) |
| ||
http://www.paulsprojects.net/opengl/rtotex/rtotex.html you can quickly convert static memory to a static pixmap... |