Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

GledPlay with MFC


GledPlay with MFC

Postby clintsinger » Dec 6, 2006 @ 1:03am

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
clintsinger
pm Member
 
Posts: 15
Joined: Nov 18, 2004 @ 1:15am


Postby Sergio » Dec 6, 2006 @ 12:59pm

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.
Here you have a link to the doc about this

Using internal Buffer.

3- You can have access to the internal Surface Buffer.
Here you'll find more info about this:
http://www.gledplay.com/doc/GledDraw/Surface.html#getBuffer
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 nativeToColorref 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.
Sergio Fierens

GledPlay
User avatar
Sergio
pm Member
 
Posts: 97
Joined: Mar 17, 2006 @ 2:43pm


Postby xavier69 » Jan 9, 2007 @ 3:29pm

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?
John Schisler
CTO / Chief Programmer

The PDA Initiative
http://www.pdainitiative.com
xavier69
pm Member
 
Posts: 12
Joined: Oct 21, 2004 @ 6:47pm


Postby Sergio » Jan 9, 2007 @ 7:57pm

Yes, it is possible. You have in GledPlay the same options you have in GapiDraw for doing so, and it's done almost in the same way. You can access the raw internal buffer of each surface (a linear buffer, from left to right, from top to bottom, in RGB565 format, 2 bytes per pixel), or you can let GledPlay create a DC with the same content of your surface, and use the GDI blitting functions (like BltFst) for blitting the content of a surface in a DC.

Best regards,
Sergio.
Sergio Fierens

GledPlay
User avatar
Sergio
pm Member
 
Posts: 97
Joined: Mar 17, 2006 @ 2:43pm


Return to GledPlay


Sort


Forum Description

Game Engine for Embedded Devices. Simple, complete, and powerful. Focused on the game.

Moderators:

Matias, Sergio

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron