Page 1 of 1

web application

PostPosted: Apr 9, 2005 @ 12:47am
by zortog

PostPosted: Apr 10, 2005 @ 4:22pm
by Johan
If you are willing to use C++ instead of C# you can use the statically linked library version of GapiDraw 3.5 to create an ActiveX component, without the requirement of a DLL on the local machine.

PostPosted: Apr 11, 2005 @ 6:43am
by InexorableTash
Fundamentally, do you want the graphics being rendered on the client or the server?

If it's the client, you'll need some client-side bits. An ActiveX (if you don't mind being IE/Windows-only) using GapiDraw (as Johan suggests) or another technology altogether - for example, you could look into Flash or Java.

If it's server, then you'll be generating images using your server's available libraries. For example, in ASP.NET you can take advantage of the the .NET GDI+ wrapers (System.Drawing) to generate high-fidelity images on the server.

These are radically different approaches than what you were thinking of, but at the end of the day you're building a web app not a client app, so something has to give - either ubiquity of the runtime or a familiar architecture.

Speaking of architecture, the "AJAX" ("Asynchronous JavaScript and XML") buzzword sweeping the 'net lately is another thing to consider architecturally. The basic idea is to realize that most apps that users want to hit on the web are ridiculously simple and modern web browsers are pretty powerful. So you build a fairly deep script-based application that gets shipped down as a web page and just relies on calls back to the server for anything that can't be done locally.

I recently threw together a starmap navigator that feels like Google maps - you can zoom and drag in real-time. The front-end is all script, and it just requests image tiles from the back end - the server runs ASP.NET and uses System.Drawing to produce the tiles on demand. It only took a couple of hours to get everything working,

For a game, you can think beyond image tiles - take advantage of z-index layering (using CSS) and transparent GIFs or Alpha PNGs to do sprites. Nearly everything would be static, too, just like image resources in a "normal" client application using something like GapiDraw.

As an added bonus, the whole thing functions in "retained mode". Most graphics systems (e.g. GapiDraw in its normal use pattern) are "immediate mode" - that is, you're redrawing everything in every frame, and the logic to draw objects and move objects is tightly coupled. With an HTML-based app, the objects are persistent and you just update positions and let the browser do the dirty work.

And this is now completely off-topic. :)

[Edited: I originally gave the acronym as JAXA not AJAX; I claim being bedridden with an illness.]

PostPosted: Apr 11, 2005 @ 9:02pm
by Guest

PostPosted: Apr 11, 2005 @ 9:21pm
by fzammetti
Never one to miss an opportunity to plug myself...

I recently published an article on Ajax...



...and I am going to begin work on contributing a chapter or two to an upcoming book on the subject.

PostPosted: Apr 12, 2005 @ 12:37am
by Guest
To be more specific, if I have a GapiDraw application running at 20 fps and I turned it into an ActiveX control which was getting all the resources it needed from my server, would that be usable on the client side if they were to be able to drag images around the screen in real time?

PostPosted: Apr 12, 2005 @ 3:23am
by InexorableTash
Re: every frame coming from the server

No - an ActiveX control is like an "applet" - it's a control (child window) and native code running inside the browser window and process. Fundamentally, there's little difference between a traditional client application (e.g. an EXE) and an ActiveX control except who owns the top-level window and the message pump. Well, and you have to understand COM.

In the past (~8 years ago), doing ActiveX was all the rage if you were in the Microsoft camp (vs. Java for the cross-platform camp); it was a one-click way to get your executable code onto the user's machine. Nowadays, it's clear that security concerns trump everything, so downloading native code that doesn't run sandboxed is something people don't want to encourage, and XPSP2 ups the number of clicks and security dialogs. (Basically, any code you download owns your system, so you'd better trust it with your life.)

PostPosted: Apr 12, 2005 @ 8:12am
by Guest
Ok, I think I'm up to speed for now. Thank you very much for your help and time, I really appreciate it :)

PostPosted: Apr 13, 2005 @ 7:13pm
by Guest
Sorry to ask ActiveX technical questions here, but I've had some trouble finding an active ActiveX forum.

I've placed my GapiDraw application into a static library and I am able to get it to start up in an ActiveX control by passing in the control's HWND and HINSTANCE.

The problem I'm having though is that my image resouces don't want to load using the passed HINSTANCE. Secondly, while I'm sure the application is running; ProcessFrame is getting called repeatedly - I don't get any mouse click events.

Can anyone help?

PostPosted: Apr 13, 2005 @ 8:12pm
by Guest
Or if the question above is no good, then how about this...

I've now placed my application directly into an activeX control, rather than using it as a static library. Now when I open the control in ActiveX Control Test Container, I get a message box saying:

"This display card does not support(640x480x16BPP)@75Hz."

I then hit ok and another message box comes up with:
"Could not open display. Error code=0xc8660110."

PostPosted: Apr 13, 2005 @ 8:21pm
by Johan
Try using "CGapiDisplay::CreateOffscreenDisplay". I would recommend NOT using the GapiApplication framework.

PostPosted: Apr 13, 2005 @ 10:45pm
by Guest
Ouch...thats going to take me a bit - thanx though:) I'll see if I can do it

PostPosted: Apr 19, 2005 @ 8:02pm
by Guest
OK I got the activeX control working finally! It ends up not being hard at all and I was able to use the GapiApplication framework. Now I just need to figure out how to put the control in a browser.

Bumped for help reasons

PostPosted: Aug 11, 2005 @ 7:56pm
by jeder