Welcome, Guest. Please login or register.

Author Topic: Basic Amiga-API coding  (Read 11869 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: Basic Amiga-API coding
« Reply #29 from previous page: August 06, 2006, 10:36:17 AM »
Intuition5 getting input from multiple windows has just beed uploaded.
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline r-tea

  • Newbie
  • *
  • Join Date: Feb 2005
  • Posts: 26
    • Show only replies by r-tea
    • http://www.ppa.pl/paubase/showuser.php?id=136
Re: Basic Amiga-API coding
« Reply #30 on: August 07, 2006, 06:07:33 PM »
@ Kronos
I might at some later time do a simple GadTools-example (as GadTools is a s simple as it gets), and later on something bout MUI, since MUI is the only GUI that I use myself.

A great idea with this tutorial Kronos!
I'll be watching this topic and wait for MUI one impatiently! :)
My dream are basic examples using MUI-hooks for handling events instead of building a high stack Aplication_Return_IDs within program's main loop.
And it would be great if those hooks will be easy to compile with vbcc :)
/* Amiga Pegasos II PPC 750CXe @ 600 */
 

Offline KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: Basic Amiga-API coding
« Reply #31 on: August 08, 2006, 03:28:59 PM »
@r-tea

Hooks for handling (input?)events ??

There is the notify-system for normal input, and MUIC_Window has a function MUIM_Window_AddEventHandler, which will call any given object (needs to be a costum-class, but one can't do much in MUI without atleast one of those) whenever an event happens (and matches the pattern you supplied).

Not gonna do a full example on this one, but drop me a mail and I send you some code-snippets from SteamDraw covering this.
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Basic Amiga-API coding
« Reply #32 on: August 08, 2006, 04:09:16 PM »
This Intuition5 example has some serious bugs in it, for example it FreeSignal()s a signal bit that is still in use. Also it makes system leak signal bits as it pokes a live msgport created by the system (intuition). This is a big no-no. The code will also reference zeropage at while(im = GetMsg(windows[sNr]->UserPort) when the window closegadget has been hit: windows[sNr] = NULL; is done, but the loop is not terminated.

Finally, it's rather silly example as it will run out of signals anyway, as it in fact allocates TWO signals per window, and leaks every 2nd of them. It also has tons of warnings, which are easy to spot and fix with -Wall.

Edit: I will not rewrite it, but instead provide a link to my shared msgport example code:
sharedidcmp.c

The example above truly allows unlimited number (limited only by the amount of free memory) windows per single process.
 

Offline KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: Basic Amiga-API coding
« Reply #33 on: August 08, 2006, 05:23:38 PM »
Intuition5 has now been removed....

Thats what ones gets trying to do something from memory, years after learning it by trial&error...

Next up GFX, and I'll try to really stay with the basics this time  :oops:
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline BrandonLee

  • Newbie
  • *
  • Join Date: May 2002
  • Posts: 14
    • Show only replies by BrandonLee
Re: Basic Amiga-API coding
« Reply #34 on: August 08, 2006, 05:36:29 PM »
@Kronos

Just thought I'd drop a line to congratulate this initiative.
I'm just starting to learn C and this tutorial couldn't have come in a better time.

Thanks!
 

Offline r-tea

  • Newbie
  • *
  • Join Date: Feb 2005
  • Posts: 26
    • Show only replies by r-tea
    • http://www.ppa.pl/paubase/showuser.php?id=136
Re: Basic Amiga-API coding
« Reply #35 on: September 11, 2006, 07:55:06 AM »
Is the lesson completed?  :-)
/* Amiga Pegasos II PPC 750CXe @ 600 */
 

Offline BrandonLee

  • Newbie
  • *
  • Join Date: May 2002
  • Posts: 14
    • Show only replies by BrandonLee
Re: Basic Amiga-API coding
« Reply #36 on: October 27, 2006, 06:01:18 PM »
Sadly, it seems it's over...