This site is no longer active and is available for archival purposes only. Registration and login is disabled.

cross platform example question


cross platform example question

Postby Structure » Mar 27, 2005 @ 6:04pm

Hi theres probably an obvious answer to this so please excuse my ignorance


In the cross platform example given in 3.5c is there a good reason why CCommonApplication cant inherit from CGapiApplication rather then have it passed in as a pointer?
A float, A float, My kingdom for a float
User avatar
Structure
pm Member
 
Posts: 147
Joined: Sep 17, 2004 @ 8:28pm
Location: UK


Postby Johan » Mar 29, 2005 @ 8:13am

The reason is that most of the stuff in CGapiApplication is platform-independent and needs to be kept separately (such as image loading).
Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby Structure » Mar 29, 2005 @ 11:56am

Ok, ive not really been exploring the intricacies of the cross platform approach as ive only been developing on the desktop so far,

But if CommonApplication was derived from myapplication, you could still call CMyApplication::InitInstance()first from CCommonApplication::InitInstance()


If you don’t implement CreateSysMemSurfaces in CCommonApplication it will still call the platform dependent function in CMyApplication,

And doing this will save the pointer reference in all of the callbacks as this will be sorted out in the vtable.



Im not saying this is a better way to do it as im sure ive probably missed something important (as always, till it bytes you on the ass!) im just interested in your opinion of the validity of this approach
A float, A float, My kingdom for a float
User avatar
Structure
pm Member
 
Posts: 147
Joined: Sep 17, 2004 @ 8:28pm
Location: UK


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

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