PDA

View Full Version : Strings mouse and more



Manolo
10-06-2008, 12:54 AM
Hi
I am fully new to openGL, but I'm not afraid ;)
I have read the Reference Manual, the Programming Guide, some
tutorials, some forums posts and some samples. I've also done
some tests. Not surprisingly, I have lots of doubts.

By now, I use winXP, but thanks to openGL and wxWidgets,
it's ease to port my app to other OS's.

I'm developing a terrain modeling app. It has to cope with
thousands/millions of points/triangles. Data may be flawed,
so user must be able to edit points and triangles. This
includes showing, zooming, selecting, changing coords, etc.

Even these jobs are done id a 2D-window, I hope openGL to
be faster than using GDI. A 3D-perspective window should
also be provided. I don't plan to use full-screen.

My first question:
- How do I know if graphics driver is using hardware memory and
GPU, and not software simulation and CPU?

For each point (and there are many), many Unicode-strings may
be displayed, with different colors.
To achieve this, I'm thinking of drawing the string in GDI memory
(so I can use several fonts), make an image of it, apply some
alpha (so blank pixels become transparent) and then copy it
directly to GL-framebuffer (zoom doesn't affect strings size).
The same goes for point representation (a pixel or circle or ...)

Many doubts here:
- What is the limit for storing so many images?
- Where are they stored, card-memory or mainboard one?
- Which is better for this, bitmaps or textures?
- Can I add them to a DisplayList?
- Where is this DisplayList stored?
- Is this really a good/fast method?

I want to use my own mouse-cursor images. If I use GDI functions
for it I know I get into troubles, specially with MS-Vista. So
I think it's better to draw them to GL-framebuffer.

Questions:
- Which buffer do I use?
- Do I use XOR any time the mouse is moved?
- Do I redraw all scene instead?

I've read about using some buffer to store information on each
object, so selecting under mouse-cursor is fast.
- How do I use it without being part of the window user sees?

My main doubt is if my approach is good and fast. I would like
an experimented developer to point me in the right direction.

Thanks in advance
Manolo

unsigned void
10-06-2008, 11:24 PM
1. There is no way to know if particular feature is hardware accelerated, this is pain of many developers.
2. To draw text, look at libraries - for example, FTGL. It caches fonts in textures, you don't have to manage them yourself.
3. System cursor is faster. You can draw your own cursor in OpenGl, but it will update with next frame - if fps are low, it will be inconvenient for user. Try to set your own bitmap to cursor - it should be possible.

_NK47
10-07-2008, 07:56 AM
to 3.
drawing cursor with OpenGL all the time requires to clear the backbuffer, redraw your whole scene and then draw the cursor on top. this is not very efficient.
even if your cursor changes often say on Win OS (*.cur) you can set it while creating a window or via SetWindowLong() if i recall correctly.