home *** CD-ROM | disk | FTP | other *** search
- Path: academy.bastad.se!news
- From: sten@academy.bastad.se (Sten Jansson)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Graphics with C
- Date: 24 Feb 1996 15:45:44 GMT
- Organization: Connection Bastad
- Message-ID: <1623.6628T957T1704@academy.bastad.se>
- References: <Dn83w3.1vv@uns.bris.ac.uk>
- NNTP-Posting-Host: academy.bastad.se
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
-
-
- >I would like to know how to open a screen and how to plot and draw to it,
- >in different colours. I have the commodore includes, but not ROM kernal
- >manuals. I am using the freeware version of DICE, as supplied onm the
- >meeting pearls II CDROM, if this is important. I am new to C programming,
- >but not to programming in general.
-
- >Even if it is not possible to plot or draw, just knowing how to get the
- >address of the screen would be useful. (I do not know the structure of
- >the RasterPort things).
-
- There are 2 ways on V 37+.
-
- 1 OpenScreen([pointer to a NewScreen structure]);
- This works with all system versions.
-
- 2
- struct TagItem scr_tags[] =
- {
- {SA_DisplayID, 0x00039020}, /*Multiscan 640*240*/
- {SA_LikeWorkbench,1}, /*Same colours as WB*/
- {TAG_DONE, NULL},
-
- };
-
- my_screen = (struct Screen *) OpenScreenTagList(NULL, scr_tags);
-
- The later is better because You can use diffrent resolutions & other
- stuff. This only works on V37+ so open intuition.library like this:
-
- IntuitionBase = (struct IntuitionBase*)
- OpenLibrary( "intuition.library", 37 );
-
- When You have opended the screen You can use this to find out the
- adress: printf("%lx\n", [the pointer that the screen opening fuction
- returns]);
-
- You can use a function called Draw() to draw lines.
- Syntax: Draw(struct *RastPort,X,Y);
- This draws a line from current cursor position to these coordinates.
- Use Move(struct *RastPort,X,Y); to move the cursor.
- U can ofcourse also draw lines directly on the screens bitmaps, but I
- wouldn'trecommend it. Hope that was some help, but U should get the Rom
- Kernal manuals.
-
- /Sten
-
-