tags:

views:

279

answers:

2

I want to make a editor and need normal win32 buttons such as textbox, buttons, etc. I also need a control for pixel access. I really dont like GDI so i am thinking i should do it with opengl. I havent done it before and i want to know if this is a bad idea before i write any code. This is what i am thinking to do this.

Create a normal window with all my control placed in it Create a locked window with no border at the location i want to draw the pixels in. initialize opengl to that window (i have never done that, can it be done?) render ONLY when i get the WM_PAINT msg.

Would this work? and will this eat a lot of CPU bc it uses opengl? i notice everything that uses opengl makes my mac mini eat cpu and turn on its fan. (it has no video memory and not the greatest card).

A: 

I think what people generally do here is do the per-pixel access in memory, using a Bitmap object, then transfer that to the screen whenever you get the WM_PAINT message. That way, you aren't writing right into the graphics system. This technique is called double-buffering.

Dave Markle
GDI is the way to go.
karlphillip
A: 

This question is not very clear. What exactly are you trying to achieve?
What are you rendering on the opengl?

In general, all OpenGL rendering should take place during a WM_PAINT. so there's nothing new in that. If you want to read a pixel from an OpenGL frame buffer practically the only option is to use glReadPixel which is pretty much always somewhat slow.

Please try to make your question clearer if you want a more specific answer.

shoosh