Welcome, Guest. Please login or register.

Author Topic: Intuition questions...  (Read 3050 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline yakumo9275Topic starter

  • Sr. Member
  • ****
  • Join Date: Jun 2008
  • Posts: 301
    • Show only replies by yakumo9275
    • http://mega-tokyo.com/blog
Intuition questions...
« on: August 29, 2011, 02:41:04 AM »
(Am writing this over the course of my workday so it kind of rambles, and I cant test examples at work)...

I want to program an amiga port for my text adventure engine. I dont quite get intuition layouts.
I am reading 'Programmers Guide to Amiga' by Robert Peck.

I want an infocom style text screen, title across the top, text below. text will scroll without interfeering with the title text and to run from workbench.

From my reading of some amiga programming books I need to create a screen, and within that screen a window? It feels like I'm creating an MDI app, and I dont want an MDI app. I just want to open a screen/window on workbench and render text to two different parts. *Ahh, I see workbench is a public screen and I can open my window on it. nice.

When dealing with the text controls, does it retain the text so a window resize will automatically reflow the text or do I have to pragmatically reflow the text?, meaning I have to keep track of the text sent to the window? I'm guessing a NEWSIZE + REFRESHWINDOW means I need to know what text I've sent to redraw it...

Is SIMPLE_REFRESH better than not specifying it? Since I am targeting wb3.1, is it good practice to use SIMPLE_REFRESH or not or go with a smart refresh window?

random thought.. can you do a memmove inside a rastport to immitate scrolling? or do I need to create an off screen rastport? Can you do a ClipBlit where the source rp + dest rp are the same?
I see there is a ScrollRaster... so in theory I should have one rastport for my title line, and one rastport for the body text... things are becoming clearer now.

Would mui help here with doing design/layout of the window interface or should I just stick to intuition?
--/\\-[ Stu ]-/\\--
Commodore 128DCR, JiffyDOS, Ultimate 1541 II, uIEC/SD, CBM 1902A  Monitor
 

Offline Franko

  • Hero Member
  • *****
  • Join Date: Jun 2010
  • Posts: 5707
    • Show only replies by Franko
Re: Intuition questions...
« Reply #1 on: August 29, 2011, 02:45:56 AM »
What language are you writing this in !!!

As you seem to be making something that's relatively simple to achieve sound rather complicated... ;)
 

Offline yakumo9275Topic starter

  • Sr. Member
  • ****
  • Join Date: Jun 2008
  • Posts: 301
    • Show only replies by yakumo9275
    • http://mega-tokyo.com/blog
Re: Intuition questions...
« Reply #2 on: August 29, 2011, 03:11:18 AM »
C. Intuition is a relic as far as event driven gui frameworks go. I'm just trying to familiarise myself with it before I start programming the front end. I'm more used to gtk2 + win32.
--/\\-[ Stu ]-/\\--
Commodore 128DCR, JiffyDOS, Ultimate 1541 II, uIEC/SD, CBM 1902A  Monitor
 

Offline Franko

  • Hero Member
  • *****
  • Join Date: Jun 2010
  • Posts: 5707
    • Show only replies by Franko
Re: Intuition questions...
« Reply #3 on: August 29, 2011, 03:28:15 AM »
Drat... :(

I only code in assembler and I probably still have the source code somewhere from a similar project I started way back in the late 80's... :(

I got as far as setting up the screen and using two intuition windows one "RAW:" & one "CON:" for the location description and the parser input. Never quite got round to finishing it though, kept trying to make the parser better for full sentence input but kinda got bored with it and never finished the project... :(

Basically all you really need to do is have to windows on your screen, one for the location description and another for the parser input. If you're wanting to stop part of the text scrolling off the screen/window this can be achieved with escape code (just like you can do in a CLI/ Shell window... :)

But as far a programming in C goes then, sorry but I can't help you with that as I never learned C... :(
 

Offline jacadcaps

  • Jr. Member
  • **
  • Join Date: Apr 2003
  • Posts: 65
    • Show only replies by jacadcaps
    • http://dreamolers.meanmachine.ch
Re: Intuition questions...
« Reply #4 on: August 29, 2011, 09:50:09 AM »
Quote from: yakumo9275;656600
(Am writing this over the course of my workday so it kind of rambles, and I cant test examples at work)...

I want to program an amiga port for my text adventure engine. I dont quite get intuition layouts.
I am reading 'Programmers Guide to Amiga' by Robert Peck.


These days nobody really does anymore - and for a good reason. Intuition uis are cumbersome and hard to write correctly.

Quote

I want an infocom style text screen, title across the top, text below. text will scroll without interfeering with the title text and to run from workbench.

From my reading of some amiga programming books I need to create a screen, and within that screen a window? It feels like I'm creating an MDI app, and I dont want an MDI app. I just want to open a screen/window on workbench and render text to two different parts.


There's no MDI contcept in AmigaOS really. From what you're writing it sounds to me like you just want a plain window with custom drawn contents. Or do you want to create a normal buttonized GUI? In that case I'd strongly recommend using MUI since that will take a lot of load off of you. Doing it directly in intuition is a bad bad idea - if you want the plain gadgets, at least use something like gtlayout (although there's no reason not to use MUI in 2011).

Quote
When dealing with the text controls, does it retain the text so a window resize will automatically reflow the text or do I have to pragmatically reflow the text?, meaning I have to keep track of the text sent to the window? I'm guessing a NEWSIZE + REFRESHWINDOW means I need to know what text I've sent to redraw it...


Intuition and graphics have no "reflow" concept at all. You have to do everything manually.

Quote
Is SIMPLE_REFRESH better than not specifying it? Since I am targeting wb3.1, is it good practice to use SIMPLE_REFRESH or not or go with a smart refresh window?


Simplerefresh is always preferred since it uses less gfx memory. This however means that your window doesn't have a buffer and you need to listen to IDCMP_REFRESHWINDOW and redraw inside Begin/EndRefresh() - meaning you always need to be ready to redraw your current window contents.

Quote
random thought.. can you do a memmove inside a rastport to immitate scrolling? or do I need to create an off screen rastport? Can you do a ClipBlit where the source rp + dest rp are the same?


There's ScrollWindowRaster in intuition.library. You could ClipBlit yourself, but to do it right would be very cumbersome.

Quote
I see there is a ScrollRaster... so in theory I should have one rastport for my title line, and one rastport for the body text... things are becoming clearer now.


Well, no. You generally have one rastport per window. You'd create more if you were to use offscreen buffers and render into these - but this means you'd have to create offscreen LayerInfos in order to have clipping, otherwise rendering out of bitmap bounds could trash memory.

Quote
Would mui help here with doing design/layout of the window interface or should I just stick to intuition?


Yes, MUI will make interface layout automagic. You'd only have to create a custom class if you needed some custom-drawn area. There are good examples how to do this in the MUI sdk archive (see ClassX.c demos).
 

Offline Jose

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show only replies by Jose
Re: Intuition questions...
« Reply #5 on: August 29, 2011, 11:56:06 AM »
@Franko
I've actually learned a bit of asm before learning C, cause I wanted to better understand what was going on on the lower level (forgot too much of it by now). If you alread know asm it's really easy to learn C, very small syntax and very efficient, you'll immediately understand concepts like pointers and registers that others learning C have big trouble with. It also makes development a lot faster.
It's a complete waste if you don't learn C now! :)
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline golem

  • Sr. Member
  • ****
  • Join Date: May 2002
  • Posts: 430
    • Show only replies by golem
Re: Intuition questions...
« Reply #6 on: August 29, 2011, 12:11:41 PM »
Quote from: Jose;656667
@Franko
I've actually learned a bit of asm before learning C, cause I wanted to better understand what was going on on the lower level (forgot too much of it by now). If you alread know asm it's really easy to learn C, very small syntax and very efficient, you'll immediately understand concepts like pointers and registers that others learning C have big trouble with. It also makes development a lot faster.
It's a complete waste if you don't learn C now! :)


I agree. I programmed my biggest Amiga project in 68k. Coming back to that source 5 years later was major brain twist. I converted it to ANSI C and it is so much easier to see what is happening. OK the code generated is bigger and a bit slower but I have an 060 and a hard drive now and not so worried about these things as in the good, old days.
                                                             
A1200 desktop, Blizzard 1260, OS3.9BB2, Indivision Mk II, SCSI Jaz, Ethernet
A1200 desktop, Blizzard 1230, OS3.1, Ethernet
A500, OS1.3
 

Offline yakumo9275Topic starter

  • Sr. Member
  • ****
  • Join Date: Jun 2008
  • Posts: 301
    • Show only replies by yakumo9275
    • http://mega-tokyo.com/blog
Re: Intuition questions...
« Reply #7 on: August 29, 2011, 02:03:21 PM »
Thanks for the info jacadcaps, I'll start looking at somem uit tutorials and docs. How much intuition knowledge is required for mui? I'm assuming I'll still get all the IDCMP messages etc?

do I need to buy mui to develop for it? I remember yerars ago you had to register it.. wikipedia says its freeware but the mui homepage is... old but still talks about registering it.

Since I'm going to have to do all my text management myself I'm wondering now if I can use freetype.. may be to slow and I should just stick to topaz...

I need to do some more reading.
--/\\-[ Stu ]-/\\--
Commodore 128DCR, JiffyDOS, Ultimate 1541 II, uIEC/SD, CBM 1902A  Monitor
 

Offline deniil

  • Newbie
  • *
  • Join Date: Jan 2004
  • Posts: 8
    • Show only replies by deniil
    • http://www.onyxsoft.nu
Re: Intuition questions...
« Reply #8 on: August 29, 2011, 02:24:07 PM »
Quote from: yakumo9275;656686
Thanks for the info jacadcaps, I'll start looking at somem uit tutorials and docs. How much intuition knowledge is required for mui? I'm assuming I'll still get all the IDCMP messages etc?

do I need to buy mui to develop for it? I remember yerars ago you had to register it.. wikipedia says its freeware but the mui homepage is... old but still talks about registering it.

Since I'm going to have to do all my text management myself I'm wondering now if I can use freetype.. may be to slow and I should just stick to topaz...

I need to do some more reading.


MUI is free now, including the MUI SDK.
MUI takes care of all IDCMP messages itself. You can write a class and intercept stuff like keystrokes etc. though if you need to.

Freetype should work I guess. Never used anything like it myself though. What OS are you on? Classic 68k OS3.x or new OS4 PPC? Typically you could just open any font, TTF or bitmap, and just draw in your window/MUI class using normal text functions. Should work on old OS3 as well with some TTF library installed and fonts available.
Developer for OnyxSoft - Amiga
A1200 BPPC060/240+BVision ; A1-XE G4/800
 

Offline jacadcaps

  • Jr. Member
  • **
  • Join Date: Apr 2003
  • Posts: 65
    • Show only replies by jacadcaps
    • http://dreamolers.meanmachine.ch
Re: Intuition questions...
« Reply #9 on: August 29, 2011, 02:33:38 PM »
Quote from: yakumo9275;656686
Thanks for the info jacadcaps, I'll start looking at somem uit tutorials and docs. How much intuition knowledge is required for mui? I'm assuming I'll still get all the IDCMP messages etc?


Almost none. You do get IntuiMessages in the event handling, but the use is fairly simple.

Quote
do I need to buy mui to develop for it? I remember yerars ago you had to register it.. wikipedia says its freeware but the mui homepage is... old but still talks about registering it.


No, you don't have to. You only need a serial number to make public MUI classes, but in your case that won't be necessary. To get a serial number you just have to PM/email me.

Quote
Since I'm going to have to do all my text management myself I'm wondering now if I can use freetype.. may be to slow and I should just stick to topaz...


Depends on your target I guess. I'd stick to graphics.library/Text() for 68k.