amiga.org
     
iconAll times are GMT -6. The time now is 12:10 PM. | Welcome to Forum, please register to access all of our features.

» Amiga.org » Operating System Specific Discussions » Amiga OS » Amiga OS -- Development » StormMesa and Picasso96

Amiga OS -- Development This particular forum deals with issues regarding development for all versions of AmigaOS.

Reply
 
Thread Tools Display Modes
Old 12-08-2002, 02:55 PM   #1
Sidewinder
Technoid
Points: 8,097, Level: 60 Points: 8,097, Level: 60 Points: 8,097, Level: 60
Activity: 2% Activity: 2% Activity: 2%
 
Sidewinder's Avatar
 
Join Date: Mar 2002
Posts: 241
Send a message via ICQ to Sidewinder Send a message via AIM to Sidewinder Send a message via MSN to Sidewinder Send a message via Yahoo to Sidewinder
Default StormMesa and Picasso96

Hello,

I'm attempting to create a StormMesa program using a P96 screen. The problem that I'm having is that the AmigaMesaCreateContext() function is throwing an exception (StormC 3 says number 8). It works fine with a normal Intuition screen so that leads me to believe it is something with the different format of the bitmaps or changes to the RastPort or Screen structures, but both P96 and StormMesa have absolutely minimal documentation. Note that I would rather not use glut, and I do not want to use a window (which works fine by the way). I would like to get this working with a screen. Does anyone have any ideas? Here is my code:

#ifdef __STORM__
#include "dos/dos.h"
#include "graphics/gfxbase.h"
#include "intuition/intuition.h"
#include "pragma/exec_lib.h"
#include "pragma/dos_lib.h"
#include "pragma/graphics_lib.h"
#include "pragma/intuition_lib.h"
#include "proto/picasso96.h"
#endif /* __STORM__ */

#include "GL/Amigamesa.h"
#include "exec/types.h"
#include "dos/dos.h"
#include "intuition/intuitionbase.h"
#include <stdio.h>

struct IntuitionBase *IntuitionBase = NULL;
struct GfxBase *GfxBase = NULL;
struct Library *P96Base = NULL;
struct Screen *GL_Screen = NULL;
struct Window *GL_Window = NULL;
struct amigamesa_context *GL_Context = NULL;

void open_libraries(void);
void close_all(void);
void display(void);

int main(int argc, char** argv)
{
open_libraries();

if (!(GL_Screen = p96OpenScreenTags(P96SA_Width, 800,
P96SA_Height, 600,
P96SA_Depth, 16,
P96SA_AutoScroll, TRUE,
TAG_DONE)))
{
printf("Unable to open screen.\n");
close_all();
}

if (!(GL_Context = AmigaMesaCreateContextTags(AMA_Left, 0,
AMA_Bottom, 0,
AMA_Width, 800,
AMA_Height, 600,
AMA_Screen, GL_Screen,
AMA_RastPort, &GL_Screen->RastPort,
AMA_DoubleBuf, TRUE,
AMA_RGBMode, TRUE,
AMA_Fullscreen, TRUE,
AMA_DirectRender, TRUE,
AMA_TwoBuffers, FALSE,
AMA_Visual, NULL,
AMA_NoDepth, FALSE,
AMA_NoStencil, TRUE,
AMA_NoAccum, TRUE,
TAG_DONE)))
{
printf("Unable to create context.\n");
close_all()
}

AmigaMesaMakeCurrent(GL_Context, GL_Context->buffer);

glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0f, 0.0f, 0.0f);
glOrtho(0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f);

glBegin(GL_POLYGON);
glVertex3f(0.25, 0.25, 0.0);
glVertex3f(0.75, 0.25, 0.0);
glVertex3f(0.75, 0.75, 0.0);
glVertex3f(0.25, 0.75, 0.0);
glEnd();
glFlush();

AmigaMesaSwapBuffers(GL_Context);

Delay(500L);

close_all();
}

void open_libraries(void)
{
if (!(IntuitionBase = (struct IntuitionBase
*)OpenLibrary("intuition.library", 39L)))
{

printf("Unable to open intuition.library.\n");
close_all();
}

if (!(GfxBase = (struct GfxBase *)OpenLibrary("graphics.library",
39L)))
{
printf("Unable to open graphics.library.\n");
close_all();
}

if (!(P96Base = OpenLibrary(P96NAME, 2)))
{
printf("Unable to open %s.\n", P96NAME);
close_all();
}
}

void close_all(void)
{
/* Destroy Context */
if (GL_Context)
AmigaMesaDestroyContext(GL_Context);

/* Close Window */
if (GL_Window)
CloseWindow(GL_Window);

/* Close Screen */
if (GL_Screen)
//CloseScreen(GL_Screen);
p96CloseScreen(GL_Screen);

/* Close Libraries */
if (P96Base)
CloseLibrary(P96Base);

if (GfxBase)
CloseLibrary((struct Library *)GfxBase);

if (IntuitionBase)
CloseLibrary((struct Library *)IntuitionBase);
}
__________________
Sidewinder
Sidewinder is offline   Reply With Quote
Reply

Bookmarks

Tags
picasso96 , stormmesa , picasso

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Picasso96 RMK305 Amiga Software Issues and Discussion 1 02-16-2008 11:24 AM
stormmesa HW under voodoo3 ? kas1e Amiga Software Issues and Discussion 0 10-05-2005 05:28 PM
StormMesa, How do you make it work? Acill Amiga Software Issues and Discussion 6 03-08-2004 06:08 AM
StormMesa Help Ami603 Amiga Hardware Issues and discussion 4 01-27-2003 04:45 AM
StormMesa fd files Amiga OS -- Development 0 01-12-2003 07:22 AM