PDA

View Full Version : API VS VCL



virtual
27-07-2009, 07:56 PM
hi

i am still not sure about what sould i use VCL or windows API for graphic programming (demos , games ) , i think VCL isn't designed to be a good thing for applications that needs much performance like 3D demos or games , so the problem is VCL's make things easy but slow , API needs hourse of coding but gives good results

am i wrong ?! , any advice would be great , thanks

Traveler
27-07-2009, 08:43 PM
Whatever is easier for you. There are components available that allow you to create an opengl instance on a TPanel component, such as glWindow written by Jason Allen. (I believe GLScene does that too, but plz correct me if I'm wrong).
You can then use all other components like you would normally use in a windows app, such as buttons or a menu.

Alternatively I can also recommend wrappers such as Phoenix or Asphyre, where pretty much all of the hard work has already been done for you, so you can immediately proceed to writing the actual game.

Brainer
28-07-2009, 07:43 AM
@Traveler There's the TGLSceneViewer component which works pretty similar to Jason's glWindow. ;)

Personally, I don't think VCL slows down your app. Maybe an application loads longer due to VCL's ballast, but I don't think it affects performance in any way. I may be wrong, of course. If you ask me, I prefer using VCL because it's easier to start off, you don't have to spend hours on writing support for pure API controls.

It all depends on a programmer, in fact.

arthurprs
28-07-2009, 11:27 PM
VCL doesn't slow down significantly, i think it only add 2 calls to deliver the messsage to the event (pretty similar or faster than others hi-level implementations)

virtual
29-07-2009, 01:08 PM
thnx

but what about all the unessesary code inside , i mean vcl built with alot of encapsulation , does this left any effect on performance ?

my question is :
is VCL suitable for real high performance graphic app ?

i don't know how to expose the problem ,ok i tryed asphyre examples in a ( P4 2GHz , 256Ram , SIS661Fx graphic card ) , all the examples run with slow FPS (20-40fps), note that the apps doesn't show a complex graphic just( spining cube , some particle , ...)

i coded some apps IN THE SAME MACHINE with pure win32 api and directx8( beginner stuff : textured cube ... ) and it run really quickly (220 fps)

so really don't know what sould i chose


sorry for my english

AthenaOfDelphi
29-07-2009, 01:36 PM
Hi virtual,

I don't know anything about the SiS661Fx chipset, but from what I've just read it only supports DirectX 7, which suggests that if the demo's do anything more than plain rendering (which, I suspect they do to show off the components) will probably result in DirectX falling back to software rendering which is why you're getting poor performance.

Just a thought.

User137
29-07-2009, 04:53 PM
That could also fall down to what timer/event manager you use? Even if your app is VCL it doesn't mean you can't use same kind of program loop as API approach, but it is not necessary...

Do the demos use vertical sync?

virtual
30-07-2009, 02:29 PM
yes with v-sync

seems like i'll take api as a final choice

thnx for replys