GapiDraw 3.x wish-list
I'll keep a running list of desired GapiDraw 3.x enhancements here. Please feel free to add your requests below (nothing about licensing though please). Obviously all of these enhancements would make for a huge DLL, so they should be plug-ins of some sort.
Johan, can you make this a sticky message please?
The current top 5 requests are posted accordingly.
#1(3 votes) Additional text support - outlining, antialiasing, linebreak, etc.
#2(3 votes) Generic, time-based sprite engine
#3(2 votes) Virtual linear backbuffer for easy pixel manipulation (pitch independent)
#4(1 vote) Drawing primitives - ellipses, polys, fills, crosshatches, gradient fills
#4(1 vote) Generic cross platform product installation system - one that installs the required DLLs only once per device. Support for PC, Mac and OTA installs.
#4(1 vote) RLE image support
#4(1 vote) SFX blts - screen rotations, blends, fades, disolves
#4(1 vote) Support for TGA loading
o Blt FX that affect only a provided RECT area on a per surface basis
o Integrated cross platform sound engine that can be disabled/overridden by the developer
o Wait a specific number of frames before resetting the timer if the frame time should be exceeded. The number of frames could be set by the user.
o Pixel shader plug-in support
o Separate forum boards for the various devices (or a way to make them distinct) - Pocket PC/Smartphone - Symbian - Palm.
o Ability to enable/disable Flip( ) while using the CMyApplication framework
o Enhanced image zoom algorithms - bi-linear, bi-cubic, etc support
o Pattern Blitting (see mlepage)
o Handling of OnLostFocus events (PC Desktop Support)
I would personally vote against the sound engine. I truly believe it is better to leave the graphics library separate from the sound library so that you can swap each out and mix and match as you see fit. I'd prefer the ability to switch out Hekkus and put FMod in (not that I'd ever do that, I think Hekkus rules) and not incur the overhead of having the sound library in the DLL, which I assume is how Johan would do it, if I didn't want to use that engine.
What I wouldn't mind seeing however is included samples that show how to use some of the more popular sound engines out there. Maybe a Hekkus, FMod and MikMod version. Might be nice to not have to figure it out, just have a clean example of how to hook it in.
Some other wish list features:
(1) Some text function additions... the ability to outline any font, antialiasing, linebreak support built in
(2) Pixelate blit effect
(3) A rudimentary sprite engine. I know, the argument was made on the PF forum that a sprite engine can't be made generic, but I believe someone with a "can-do" attitude can pull it off. It's not going to suffice for everyone in every case, THAT goal I think probably is impossible. But if it works 25% of the time, that's 25% less time I need to do my own custom coding, right?!? And that's the whole point of using a library like GD in the first place, right?!?
(4) Pixel shaders. These should NOT be active by default for any purpose because of performance considerations. But, I think if you understand the implications of shaders and use them when appropriate and as appropriate, I'd love to see that capability added.
(5) Some more primitive drawing tools, including ellipses, circles (if it needs to be a special case of ellipse), polygons, and filled variants of all of the closed polygons.
(6) A flood fill function separate from the filled polygon functions. Comes in very handy for many things. This is one of those things that can cream performance if you use it wrong, but if it's implemented well, then you leave that decision to the application developer.
(7) Just for development purposes, I'd love the ability to be able to change the window size on the fly. I don't think you can do that now. I'm talking about the config.dwDisplayZoomWidth and height parameters. I don't know about anyone else, but I set them to 240 * 1 and 320 * 2 and just change the multiple to 2 when I'm developing on the desktop so I don't have to squint. I'd love to be able to do that real-time for those times I need to do a screen capture at *1 to check pixel placements, but then not have to shut down, change it back to *2 and recompile when I'm done.
(8) Surface shift and rotate functions. For instance, it would be great if I could have a surface and rotate it's contents left (rotate meaning no bits are lost from the left, they reappear on the right). I know, I can implement this myself with blitters, but it'd be nice if they were built-in. They come in handy to duplicate some of the old C64 effects where you did character data rotation to make larger animations.
I have one from mlepage: Wait a specific number of frames before resetting the timer if the frame time should be exceeded. The number of frames could be set by the user.
fzammetti wrote:(2) Pixelate blit effect
What is this one Frank? A dissolve blt?
G.R., I'm not even sure I can explain pixelation well... it's kind of like the effect you'd see if you zoomed into an image... you absolutely know it though, even if the name doesn't ring a bell, we've all seen it numerous times.
If I recall how it's done, it's basically taking an image, doing and interpolation of some number of pixels (called a "cell"), and then taking that cell value and using it to fill in those same pixels. So in other words, if you take the pixel 10,10 in an image, you would do an interpolation of it with it's surrounding neighbors, maybe 5 pixels out in all directions, then that 25-pixel square around it that you used for the interpolation you would fill in with the result of the interpolation. The result is a big blocky-looking version of the original image. Usually people do this effect and they start with a small cell size and expand it each frame for a kind of dissolve effect (or vice-versa to dissolve in).
And you know what? As I'm describing it, I don't think it's at all appropriate for a blit effect!

So I think we can scratch that one from the list. For some reason last night I thought there would be an easy way to integrate it with a blitter, but now I don't think that is so.
Ok, I understand what you're describing now. I lumped it under SFX blts since there are so many that could be implemented. I think these limited use items would be nice to have in a layer that sits above GD as a plugin - a nice modular approach. I would imagine that alot of these requests could simply be classes that you include in your project - like JoJoSip or JoJoPowerBar.
Yes, that makes a lot of sense. One idea that comes to mind is to look into Photoshop plug-ins... maybe it's possible to use those as real-time effects... I think many of them are just transformation matrixes, or a set of calculations. It might be worth looking into since there are so many out there already, if they could be used that way it would be an instant capability that would be incredibly powerful.
just because the pixel shader thing comes up again and again:
i don't see how these could be used efficiently without inlining the shader code, which requires the source code of the function into which it's supposed to be inlined...
Daniel
drgoldie: We might just make the source code for a generic blitter with and withour color key available in a future release...
Another suggestion... it would be very nice if GD contained functions to retrieve the total amount of memory used by an app. It might be even nicer if it could give me total app memory as well as total memory used by surfaces, fonts, etc.
Take a look in the forums on my website. I have info on how to extract the memory usage of your app.
Yep, I know, that's why I figured Johan would have no problem adding it
I was just thinking that it's the kind of thing that might be nice to include in the library itself. Certainly not going to add much girth to the code or the DLL, not going to hurt performance, etc.
Johan wrote:I have one from mlepage: Wait a specific number of frames before resetting the timer if the frame time should be exceeded. The number of frames could be set by the user.
Another related one from me: provide a way to disable/reenable the flip of the backbuffer to the screen.
mlepage wrote:Another related one from me: provide a way to disable/reenable the flip of the backbuffer to the screen.
Do you mean while using the CMyApplication framework? As long as you're not using ProcessNextFrame, you have complete control over when Flip() is called. I use this technique in Warlords II - I only update the screen display when actually needed, so the framerate is usually way below 1 fps.
Yes I mean using the CMyApplication framework. I already edited my copy to provide this functionality.
Last night while doing some design stuff, I came upon a feature I actually needed but isn't included in GD. How about a fillrect w/ gradient feature? (GDFILLRECTFX_GRADIENT, .dwColor1, .dwColor2) I believe this won't be that hard to implement?
- Erick
mlepage wrote:provide a way to disable/reenable the flip of the backbuffer to the screen.
egarayblas wrote:How about a fillrect w/ gradient feature? (GDFILLRECTFX_GRADIENT, .dwColor1, .dwColor2)
I added both to the list. The gradient fill should probably have a direction type as well (ie left, right, up, down, center-outward, spiral, etc)
Forgive me if this has allready been mentioned.
I'd like to see the zooming algos cleaned up maybe with bicubic / bi-linear / NN versions. This may save people time when porting to other deviecs and not having to resize there gfx etc.
-B
Here's another one: the ability to rotate the d-pad controls independently of rotating the display.
With some games, it's not necessary to rotate the display because there really isn't any "up" or "down". However, users still might want to rotate the d-pad input to hold the device sideways to play.
Just so you know.. Once the Palm version is stable we will begin adding some new cool features to GapiDraw and we'll pick many from this list. So please feel free to continue adding to it...
Hey how about a GBA port ^_~
how about adding an image loading functions which is not apart of the createSurface.
well because i use the console mode in symbian and we can't load images (without coding our own stuff).
so adding something like we have in winApi (LoadBitmap) alike function would be cool.
well, thats my wish anyway

We're just about done with our first game using gapidraw, and I have just a few MAJOR requests:
1) A way to dynamically switch between windowed & Fullscreen modes on a desktop PC. By dynamic, I mean while the game is running (without restarting).
2) *MOST IMPORTANT* Access to ALL the keys on a desktop pc keyboard! This is killing us right now...
I realize that these feature requests are not really important for PDA's, but we want to use Gapidraw for both desktop & mobile, and well, we need the features (and I bet a lot of other developers who want to do the same thing will need/want these features too)..
Incidentally, if there is a way to handle these situations using the current gapidraw, please let me know! Save us all a lot of trouble.
Thanks for listening! =)
Eric
p.s. Gapidraw rocks!
I'm pretty new to Gapi Draw so I might of missed something in the documentation about this. If I did please just ignore my rambling. With that said, I would like to see a tileable surface. For example in the blt function it would be simply an added flag. I could see something like this:
- Code:
m_MyBackground->blt(
RECT( 0, 0, 200, 200 ),
m_MyTile,
RECT( 0 + TILE_AMOUNT, 0, 128, 128 ),
GDBLT_TILE, //new flag
m_MYGDBLTFX );
This is basically saying that I want m_MyTile to tile across m_MyBackground starting with an offset of TILE_AMOUNT in the X direction and 0 in the Y direction. This could be so useful in so many different things I could think of which is why I wouldn’t be surprised if I’ve just missed it in the API. Of course to make things even cooler it would be really nice if the dwRotationScale was supported so it not only could tile but could be stretched. Ooo and just think about the dwRotation too! Oh I’m drooling…. Thanks for listening.
I just wanted to say that we regularly visit this thread to collect features.. So please keep'em coming. I'll start a new thread with features of the upcoming GapiDraw 3.5 release, and when that's out of the closet we can focus on the next major 4.0 release to add some really cool stuff (the idea of a plugin-engine is kind of neat, as suggested by G.R. Moore).
I'd love some shadowing functionality... something as simple as being able to add real-time drop-shadows would be cool as hell. Obviously it could be a major performance-killer, so it would be left up to the developer whether it's worth it or not, but I'm thinking of my current game project where I have a plasma background with some text and graphics and such over it... There's no easy way I'm aware of to have a real drop-shadow with blur and such because of course you get bleed-through of your transparency color... If I could flip a switch on a surface that says "add a drop-shadow when blitting this surface" and be able to define X&Y; Direction, Blur and Opacity, that would be fantastic.
Then again, why stop at shadowing? Why no introduce real filters (which I guess is along the lines of the plug-in idea, but specifically for effect filters).
I'm not sure if you can do this now or not...
It would be nice to do a blit of a masked surface, but instead of leaving the mask part transparent, blit a pattern. This will be more efficient than first blitting the pattern, then blitting the masked surface over top of it.
Actually, support for patterns would be cool itself.
I may have suggested this before, but a rudimentary sprite class might be nice. I know the standard argument against the idea is that each game is so different that a general-purpose class is not feasible. My feeling though is that something that covers as many bases as possible will probably suffice for many cases, and if it's not going to be a massive development effort on Develant's part (and I don't see how it would be since a relatively simple sprite class is, well, relatively simple!), it might save developers time, which is a large part of the point of GD or such libraries in the first place!
Actually I wouldn't want a sprite class.
But pattern blitting is generally useful and quite common. The Macintosh QuickDraw routines had it forever.
What I really want is the ability to specify something else to draw for the transparent part of a masked image, instead of just drawing nothing. It would be nice to be able to specify a solid colour, a gradient, another image, or a pattern (basically a tiled image).
The reason here, is that blitting one thing over another is very common, and this does it all in one step, saving overdraw and therefore enhancing performance.
For example, if you were doing a side scroller, you could blit the masked platforms over a pattern background, then you'd just have to blit your player/enemies/etc. over top. You'd save a lot over first drawing the background then drawing the platforms.
Well, you get your pattern blitting, I'll take the sprite class.
Okay I will vote for the "dynamic fullscreen-windowed mode switcher".
Another feature that will be handy for PC game developers is the addition of an "OnLostFocus" event for GapiApplication. Gapidraw is now used on most PC casual games so these features will surely be very useful.
- Erick
I've updated the list again. Please check to see if I've missed any requests...
The only one you missed on that list, although you might have been considering it part of the SFX blits, I think it should be separate though, is layer manipulations, things like shifts, rolls, flips, mirrors, etc. The difference here is that these would literally perform the operation on the surface, not simply blit it as such. Especially things like shifts, where the pixels dropping off one side are moved to the opposite side, that allows you to do some wickedly cool scrolling effects easily.
One other thing I'd love to see, although I have no idea if it's feasible or not, is a "virtualized" backbuffer. What I mean by this is a linear, two-byte per pixel backbuffer that you can directly access without worrying about pitch. This would make many types of algorithms much more efficient and simpler to code. Think plasma, fire, interpolation-based effects, etc. Assuming GD could then blit that buffer to the real backbuffer (or bypass that step perhaps and blit it directly to the screen in place of backbuffer), that would be very cool. I would envision this as something you could switch on and off... either GD uses the current backbuffer model, or you use this virtualized buffer in place of backbuffer... that way the application developer can decide to take the performance hit or not (I assume there would probably be one, but maybe not too severe).
Then again, don't you get exactly this by using PocketHAL? I'm not too familiar with it, but I thought I read something that sounds like this... Might be nice to be able to do natively in GD without using PH, just gives more choice and flexibility.
Johan, could you add a supprot for TGA format in CreateSurface method (with & without alpha chanel).
I updated the wish list again. Since there's not been alot of requests made lately, maybe we can start looking at the priority of each request?
Please post your top 5 priorities of the listed requests and I'll keep them ordered accordingly.
Thanks all. TGA support is also on our internal list..

(1) Drawing primitives - ellipses, polys, fills, crosshatches, gradient fills
This is one area where GD is somewhat lacking... I'd like to see it addressed.
(2) Additional text support - outlining, antialiasing, linebreak, etc.
With text being such an important part of virtually any product, expanding this functionality to be as powerful as possible is a good thing.
(3) SFX blts - screen rotations, blends, fades, disolves
Anything that in the end requires less developer time and effort is a good thing.
(4) Generic, time-based sprite engine
Along the same lines as the above... Your probably not going to be able to cover all the basis in a generic way, but even covering half of them would be a plus.
(5) Virtual linear backbuffer for easy pixel manipulation (pitch independent)
I think this one is kind of covered by using PocketHAL, isn't it? If so, change this to the pattern blitting one. It would still be nice to have a linear buffer without PH though, gives more options.
fzammetti wrote:
(4) Generic, time-based sprite engine
Along the same lines as the above... Your probably not going to be able to cover all the basis in a generic way, but even covering half of them would be a plus.
Johan, if you're interested in implementing our SpriteEngine (or the whole RaptureEngine for that matter) as a GD plugin, contact me about it.
fzammetti wrote:
(5) Virtual linear backbuffer for easy pixel manipulation (pitch independent)
I think this one is kind of covered by using PocketHAL, isn't it? If so, change this to the pattern blitting one. It would still be nice to have a linear buffer without PH though, gives more options.
I agree. I like that pHAL is supported, but I don't have plans on using it. A generic linear buffer I would use however.
G.R., I certainly wouldn't mind your things being available as plug-ins, but I would prefer something taht wouldn't require extra licensing fees.
I guess you could make the argument that if you want the sprite functionality without rolling it yourself, then the plug-in option is a good one and who am I to complain if I don't get a "free" option (meaning one included with GD at no additional cost). I guess I don't have a good argument against that

Kind of like saying I want all the beenfits of PocketHAL built-in to GD without having to pay extra for PocketHAL. Wouldn't really be fair to say that.
But I'm saying it anyway

Yep, I would like to see the SpriteEngine and RaptureEngine included as free plugins with the GapiDraw license. Of course what releases of GapiDraw it would/could be included with would be up to Johan if he was interested in doing it.
Hell, I may just release it as an open source project with the stipulation that ppcStudios has to be credited in any application it is included with. Maybe as donation-ware. Would there be interest in that?
ppcStudios wrote:Would there be interest in that?
I for one would like to see the rapture engine included. Its something that I keep meaning to toy with
How about throwing that book you was writing in for free as well

TGA format is very suitable for GapiDraw.
Because It can carry 32bits with 8-bit alpha channel and looks like bmp internally.
So It would be compressed good by GapiVFS.
And we get smaller VFS file with fast image loading .
Here are some things I'd like to see in the future of GD:
1.) More text support definitely. One main one being multiline text drawing. Ideally it would be where you specify a target width w/ your text and CGapiBitmapFont and it will fill in as much as it can.
2.) A sprite engine would be nice.
3.) TGA Support!
Also, with regards to a sound engine, I would not want to see in GapiDraw; Think about it: GapiDraw.
Johan,
Have you considered the idea of writing a version of GapiDraw that sits on top of OpenGL ES? For mobile devices that contain dedicated 3D hardware, this would seem to be a better way to go that have to access a dumb frame buffer across what is typically a non-optimal data bus from the CPU to video RAM. It wouldn't make much sense for devices that were doing software rasterization in their OpenGL ES drivers, but if there is a GPU onboard (like in the new Dell X50v) I think it would be a tremendous win because you get alpha blending, rotation, zooming, flipping, etc. all for free in the 3D hardware. Just a thought.
cheers,
digby
Why not CGapiRGBASurface supported on Symbian?
It is very convenient to use the png with integrated alpha (less space and CPU power used to load 1 image instead of 2 separate: image and alpha)
The Symbian PNG reader does not support PNG alpha information. And to the best of my knowledge libpng is not yet available in a stable version for Symbian.
Johan wrote:The Symbian PNG reader does not support PNG alpha information.
I load PNG's with alpha in my framework using CMdaImageFileToBitmapUtility.
I'd like to see more functionality added to the CGapiRGBASurface class, similar to what CGapiSurface has. ESPECIALLY a FreeSurface() function (CGapiRGBASurface::CreateSurface(0, 0, 0) workaround is NOT working - it throws an error). Other functionality would be drawing (pixels, lines, rects) and text. Also, I noticed CGapiSurface provides pixel perfect collision detection with CGapiSurface::Intersect(...), I'd like to see something similar in CGapiRGBASurface.
Even if there are "workarounds" to get this done using CGapiRGBASurface, adding the functions for convenience would be appreciated.
Thanks for listening.
Thanks for the feedback. Our current focus is actually on RGBA surfaces and you should see lots of improvements in this area in the future.
We'll add CGapiRGBASurface::FreeSurface() in the upcoming 3.5b release. In the mean time, try calling:
myRGBAsurface.CreateSurface((DWORD)0, (DWORD)0, (DWORD)0);
This will free all resources allocated by the surface.
Hi again. I'd like to make another suggestion if I may.
I noticed that GapiDraw does not use "const correctness." What I mean by this, is that const is not used to specify read only functions, or functions that do not modify any members of the class. This makes it difficult to use const without having to apply a const_cast<>. Example:
CGapiSurface, CGapiRGBASurface, and so on, have obvious functions that you would expect to not modify anything in those classes. GetWidth() and GetHeight() are the two most obvious examples. Using this in either a const function or a const pointer or reference will throw an error. What if someone, for example, wants to pass CGapiSurface as a const reference or use it in a const function? They'd be unable to without doing the following:
CGapiSurface& surface = const_cast<CGapiSurface&> const_surface;
DWORD val = surface.GetWidth();
Needless to say, that's quite ugly.
My suggestion for the next version is to add some "const correctness" to GapiDraw, and provide overloaded const functions where appropriate. Example:
// CGapiSurface class - an overloaded const function for GetWidth().
DWORD GetWidth() const;
This would not harm the current code in any way, and give us const users an interface to work with in an elegant way.
I am certainly not an expert in these design decisions, but I have done some research on const before providing this suggestions. It seems unanimous from other programmers that const should be used where appropriate, and may (note: MAY) even provide some minor optimisations by the compiler.
Here are two links in which I was provided for information on const and its usage:
http://www.gotw.ca/gotw/081.htm
http://www.gotw.ca/gotw/006.htm
Thank you for your time.
dan.p: Thanks for the suggestion. It's actually already on my todo-list, but since it requires some heavy code changes internally in GapiDraw I have saved it for an upcoming release.
In the mean time, it should be quite easy to write your own "surface wrapper", e.g. "CSurface" in namespace "gfxlib". It shouldn't take more than a couple of minutes to put it together, just copy the class description of CGapiSurface, add a member variable "CGapiSurface* m_pSurface", and call the appropriate the function.
I believe most people use their own wrappers to GapiDraw, which is why not more have complained about the const correctness.

I actually ended up just declaring the CGapiSurface (or whatever else I use) as mutable, so I can avoid the nasty const_cast<>. However, I'm more interested in the optimisations that could possibly be provided from const.
Here's an interesting topic on GameDev.net about it:
http://www.gamedev.net/community/forums ... _id=296382
Me again.
I'd like to make a few suggestions if I may based on observations with the CTimer class:
1) GetActualFrameTime() doesn't include the sleep time. I think it should, or at least there should be a function that does. Reason being, I use the frame time for my time based movement and animation. object.x += unitsPerSecond * frameTimeInSeconds; It's simple, logical, and works wonders. I'm sure I'm not the only one who uses this method. However, I can only get it to work if I don't limit the frame rate, because GetActualFrameTime() provides unusable values when I do limit the frame rate (unless I'm missing something).
2) Any possibility of getting a GetCurrentTime() function? This would return the current time, ie; how long the timer has been running for. I can obviously do this myself, by adding GetActualFrameTime() together each frame (assuming I don't limit the frame rate), but it'd be nice to have an easy access function for this where it belongs: in the timer class.
Thanks for your time!
As for (1), most people base the animation on frame rate, rather than rendering times. Thus, use the function GetActualFrameRate of CGapiTimer and base your animation on that.
As for (2), simply calling GetTickCount will do the trick on Windows Mobile. If you want to target Stationary PCs you have to use a "high performance timer" instead, but it's just to look it up in the help document.
This is my first post here, but I thought I'd chime in on the general purpose sprite engine.
There is currently a open source general purpose sprite engine for the Mac called
SpriteWorld. The code is entirely in C and while the blitting code and some support code would require porting, the basic underlying engine should be easy to port. This engine includes many features, including time based animation, FPS based animation, multiple layer tile maps, multiple sprite layers, scrolling (sprite, tile map and background image), fast pixel precise collision detection (sprite to sprite and sprite to tile) and advanced memory managment.
It would take some effort to port it to the PocketPC, but I think this would be worth doing. I've used this engine on the Mac and it's very fast, even on slower processors and very easy to use. I have tried porting it myself, but I am still learning Windows programming and got overwelmed. Maybe a group project?