Welcome, Guest. Please login or register.

Author Topic: openscreen problems!!!  (Read 5443 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline jonssonjTopic starter

  • Sr. Member
  • ****
  • Join Date: Oct 2003
  • Posts: 254
    • Show all replies
openscreen problems!!!
« on: March 22, 2004, 08:06:10 PM »
Hello!

I´m trying to open up an ordinary screen. this example comes directly from the RKRM Libraries, page 44.

the problem is that this programs hang my computer. It opens up the screen, and the screen flashes when displaybeep is called and then it waites the 2 seconds, and then everything freezes. I can´t even move the mousepointer.

I have a voodoo card in my machine, and I´m running my ordinary workbench here. But should´nt I be able to open up a standard screen on the other output? Do you have any hint?

Here is the program:
==============================================================
#define INTUI_V36_NAMES_ONLY   /* We will use the newer Intuition names. */

#include     /* Amiga Datatypes */
#include  /* Lots of important intuition! */
#include  /* structures we will be using */

#include   /* Function prototypes */
#include
#include

struct Library *IntuitionBase;  /* Intuition library base */

int main(int argc, char **argv)
{
 UWORD pens[] = { 0 };    /* This is the minimal pen specification */
 struct Screen *my_screen;   /* Pointer to our new custom screen */
 struct ExtNewScreen myscreen_setup; /* Same as NewScreen with tags attached */
 struct TagItem myscreen_tags[2]; /* A small tag array */

 /* Open the library before calling any functions */
 IntuitionBase = OpenLibrary("intuition.library",0);
 if (NULL != IntuitionBase)
 {
  /* Fill in the tag list with the minimal pen specification */
  myscreen_tags[0].ti_Tag=SA_Pens;
  myscreen_tags[0].ti_Data=(ULONG) pens;
  myscreen_tags[1].ti_Tag=TAG_DONE;

  /* The screen is opened two bitplanes deep so that the
  ** new look will show-up better. */
  myscreen_setup.LeftEdge=0;
  myscreen_setup.TopEdge=0;
  myscreen_setup.Width=640;     /* Smaller values here reduce    */
  myscreen_setup.Height=STDSCREENHEIGHT; /* drawing area and save memory. */
  myscreen_setup.Depth=2;      /* Two planes means 4 colors.    */
  myscreen_setup.DetailPen=0;    /* Normal V34 pen colors   */
  myscreen_setup.BlockPen=1;
  myscreen_setup.ViewModes=HIRES;
  myscreen_setup.Type=CUSTOMSCREEN | NS_EXTENDED; /* Extended Newscreen flag */
  myscreen_setup.Font=NULL;
  myscreen_setup.DefaultTitle="My Screen";
  myscreen_setup.Gadgets=NULL;
  myscreen_setup.CustomBitMap=NULL;

  /* Attach the pen specification tags to the ExtNewScreen structure */
  myscreen_setup.Extension=myscreen_tags;

  if (NULL != (my_screen = OpenScreen((struct NewScreen *)&myscreen_setup)));
  {
   /* Screen successfully opened */

   DisplayBeep(NULL);

   Delay(200L); /* Normally the program would be here */

   CloseScreen((struct Screen *) my_screen);

  }
  CloseLibrary((struct Library *) IntuitionBase);
 }
 return 0;
}
==============================================================

thanks for all help that I can get!
/Jörgen
 

Offline jonssonjTopic starter

  • Sr. Member
  • ****
  • Join Date: Oct 2003
  • Posts: 254
    • Show all replies
Re: openscreen problems!!!
« Reply #1 on: March 22, 2004, 08:26:14 PM »
Hello Kronos, and thanks for your reply!

This is an example directly from the RKRM Libraries manual, and for now, I´m only trying to get things to work the old way, before I get to the new thins, like Tags and so on.

Ok, I will try to put in some printf statements, but I doubt, that the text will be visible on the screen. How do I put text on a screen? Is´nt there a function like, Text() or something?

/Jörgen
 

Offline jonssonjTopic starter

  • Sr. Member
  • ****
  • Join Date: Oct 2003
  • Posts: 254
    • Show all replies
Re: openscreen problems!!!
« Reply #2 on: March 22, 2004, 09:48:18 PM »
I use the Storm C V4 compiler/editor. I´m using the default configuration. I´m compiling "debug version".

/Jörgen
 

Offline jonssonjTopic starter

  • Sr. Member
  • ****
  • Join Date: Oct 2003
  • Posts: 254
    • Show all replies
Re: openscreen problems!!!
« Reply #3 on: March 22, 2004, 11:00:19 PM »
Ok, the error seems more complicated than I thought. When running my workbench in aga mode and runs the cpp program, The screen opens up, it flashes and then it seems to close and the system is still running. But I get this message from the Storm C V4 output window: "Screen 0x7877a948 not closed"

So I suspect that the screen does not close properly, and that´s probably the cause to my system freeze also. If the screen does´nt close, I don´t get my WB on the Voodoo card back.

So, why does the screen not close? any hints?

/Jörgen
 

Offline jonssonjTopic starter

  • Sr. Member
  • ****
  • Join Date: Oct 2003
  • Posts: 254
    • Show all replies
Re: openscreen problems!!!
« Reply #4 on: March 23, 2004, 10:02:53 AM »
Hello Thomas!

Do you have a Voodoo card? It seems to work fine when I'm only using AGA, but not when I have the WB on the Voodoo.

I will try to compile the release version when I get home today.

Is there any else that have a Voodoo and are using Storm C V4, that can test the program?

/Jörgen
 

Offline jonssonjTopic starter

  • Sr. Member
  • ****
  • Join Date: Oct 2003
  • Posts: 254
    • Show all replies
Re: openscreen problems!!!
« Reply #5 on: March 24, 2004, 11:45:04 AM »
Thanks to you all for your replies.

Ok, I will have to take a closer look tonight, when I get home from work. I really, really, really, really!!!!!!!! hope that I get my BPPC card today. I have now been waiting 13 business days if I count today also.

@Thomas
The problem remains though, with the program above. I can't run it, if my WB is on the Voodoo card. My Amiga will freeze totally on the native screen that I have on a second monitor. But if I change my WB screen to the aga mode and use the second monitor only, then it works as you describes above.

Well, I will try your example tonight.

/Jörgen
 

Offline jonssonjTopic starter

  • Sr. Member
  • ****
  • Join Date: Oct 2003
  • Posts: 254
    • Show all replies
Re: openscreen problems!!!
« Reply #6 on: March 25, 2004, 09:51:45 AM »
@Noster
Hello!

No I'm using Picasso 96.

/Jörgen
 

Offline jonssonjTopic starter

  • Sr. Member
  • ****
  • Join Date: Oct 2003
  • Posts: 254
    • Show all replies
Re: openscreen problems!!!
« Reply #7 on: April 05, 2004, 02:30:55 PM »
Hello!

I would of course rather want to open up a p96 screen, but I have not proceeded that far. I just want to learn the basics first and then move on to the new stuff, but it seems that I will have to learn the new stuff right now, because the old stuff does not seem to work any more.

I don't know if this is due to the relative new compiler Storm C V4 or if it's the "new" OS 3.9 that makes this hard.

I have now tried two examples directly from the RKRM manual and I cannot get any one of them working. The first one was to use the DisplayBeep function that does not work (and yes I have tried it in AGA mode and not in RTG mode) and now I can't get this simple screen to open up and close.

I just hate it when I get stuck in things like these. I lose all the inspiration to continue and then it will take a long time before I tries again.

I will try the Amiga-M button trick tonight, and see if I get the RTG Screen back. I have tried to run the program from the shell, with the same result. Maybe I just should switch to another compiler? I don't know...

/Jörgen
 

Offline jonssonjTopic starter

  • Sr. Member
  • ****
  • Join Date: Oct 2003
  • Posts: 254
    • Show all replies
Re: openscreen problems!!!
« Reply #8 on: April 05, 2004, 03:57:26 PM »
Hello again!

No, I'm not running any screenmode promotion utilities. I will try your tip on using the Amiga-M button and see if that is the solution.

Thanks again...

/Jörgen