comp.lang.ada
 help / color / mirror / Atom feed
* Windows, DirectX, DLLs, and Gnat
@ 1998-08-13  0:00 Dobes Vandermeer
  1998-08-14  0:00 ` Tom Moran
  0 siblings, 1 reply; 2+ messages in thread
From: Dobes Vandermeer @ 1998-08-13  0:00 UTC (permalink / raw)


I am trying to write a game in Ada.  It will be multi-platform, but I am
 starting with Windows.  I am just learning Ada programming, and I am also new
 to Windows programming.. I guess I like to swim upstream...

Anyway, I have several questions:

1) How do I get to WinMain?  I need my hInstance for DirectX, and I do not know
 where it goes when my Ada program starts up.

2) I understand that I have to make a .lib file, and write some pragmas to
 interface to the Windows DLL's, but how do i
        a) Ensure I am using the correct parameter passing system
        b) Ensure that the structures going to and from these functions will be
 the right size, with the right fields

3) I am planning to draw by rendering the full image into a buffer, and blitting
 it to the graphics card using DirectDraw.  How do I create a dynamically
 allocated storage for the drawing buffer?

4) Is there a FAQ for this newsgroup?  Where?

5) Are there any valuable online resources specifically for people interested in
 coding Ada under Win32 that I should know about?

6) Is there a package that already does this for Ada?

Thanks in advance,
Dobes




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Windows, DirectX, DLLs, and Gnat
  1998-08-13  0:00 Windows, DirectX, DLLs, and Gnat Dobes Vandermeer
@ 1998-08-14  0:00 ` Tom Moran
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Moran @ 1998-08-14  0:00 UTC (permalink / raw)


There is complete source for several compilers for three demos of Claw
at www.rrsoftware.com  Even if you don't decide to buy the full Claw,
you can get answers to some of your questions just by looking at a few
specific parts of the downloadable source code.
>How do I get to WinMain?  I need my hInstance
See the Claw.Low_Level package body - this is one of the few compiler
specific parts, so make sure you look at the correct one..

>pragmas to
> interface to the Windows DLL's, but how do i
>        a) Ensure I am using the correct parameter passing system
>        b) Ensure that the structures going to and from these functions will be
> the right size, with the right fields
See any of the Claw packages, most simply Claw.adb  Note that not all
compilers "do the expected thing" with record layout - you ought to
write rep clauses for anything where layout matters (ie, any records
passed to/from the OS).  

>I am planning to draw by rendering the full image into a buffer, and blitting
> it to the graphics card using DirectDraw.  How do I create a dynamically
> allocated storage for the drawing buffer?
There is an example of this in the Shelves demo in the full (not the
demo) version of Claw.

> Are there any valuable online resources specifically for people interested in
> coding Ada under Win32 that I should know about?
As one of its authors, I naturally think the TriAda '1997 paper "CLAW,
a High Level, Portable, Ada 95 Binding for Microsoft Windows" is such
a resource. :)

> Is there a package that already does this for Ada?
Claw.  There are also others, of course.  I presume you've looked at
the thinner win32ada and at http://stad.dsl.nl/~jvandyk 







^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-08-14  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-13  0:00 Windows, DirectX, DLLs, and Gnat Dobes Vandermeer
1998-08-14  0:00 ` Tom Moran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox