Page 1 of 1

GledPlay with MFC

PostPosted: Dec 6, 2006 @ 1:03am
by clintsinger
Hi,

I would like to try the GledPlay library in an MFC application on Windows CE. What does one need to do in order to get a Surface drawn on the screen. Obviously I won't be using the StateMachine or Application as base classes.

Cheers,
Clint

PostPosted: Dec 6, 2006 @ 12:59pm
by Sergio
Hi,
This is a really interesting question.

You have to option: getting a GDI handler and use GDI routines (like BltFst) or using the Surface internal buffer.

Getting the GDI handler:

You can get a GDI handler from a GledPlay Surface, so you can use GledPlay surfaces with any GDI routine.


Using internal Buffer.

3- You can have access to the internal Surface Buffer.
Here you'll find more info about this:

Basically, you'll have access to a pixel matrix, and you can create you own blitting routines.
Pixels are natively stored as RGB565, but you can use the method to convert them to standard COLORREF values.

Now, there is a little problem with screen initialization.
If you don't use StateMachine or Application as base classes, currently, there is no way to tell GledPlay to automatically initialize the backbuffer display or the sound system. That's something we are working right now, and next week you'll have 2 new classes: Device and Display. With them (and a little help of other classes like Fps) you'll be able to create you own custom "Application base classes".

I hope this is usefull for you, otherwise, please let us know, and we'll see what we can do about it.

Best Regards,
Sergio.

PostPosted: Jan 9, 2007 @ 3:29pm
by xavier69
Is this possible yet? Really want I'm looking to do is use something faster than GDI to render things for my application and then do a final blt to the DC when I'm done drawing. In GapiDraw, this is accomplished by using their offscreen buffer and it's quite simple. Is this something that's possible with GledPlay?

PostPosted: Jan 9, 2007 @ 7:57pm
by Sergio