View Single Post
Old 03 December 2013, 12:54   #1
Cowcat
Registered User
 
Join Date: Apr 2013
Location: Mallorca
Posts: 675
WarpOS MiniGL blues.

Hello fellow coders:

I've been playing with the old Minigl static lib for months, trying to compile programs like BlitzQuake-GL or whatever GL code related for that Warpos lib. Reading old threads, gl-BQuake on Warpos leads to a crash in some systems (seems to be no problems with Mediator + Voodoo gfx, only on BVision ones). The same happens with vertex array demos from the library. No problem at all with 68k lib.
Depending on the code, you get a full hang or a "memory protection violation - Access 000000CE" exception.
So I tested some Warp3D code and found that if you use a classic function like :

Code:
void DrawThings(vertex  *P,W3D_Texture *tex)
{
void *VertexPointer;
void *TexCoordPointer;
void *ColorPointer;
UWORD stride=sizeof(vertex);
UWORD off_v,off_w;

	VertexPointer=	(void *)&(P->x);
	TexCoordPointer=(void *)&(P->u);
	ColorPointer=	(void *)&(P->RGBA);
	off_v=(UWORD)( (ULONG)&(P->v) - (ULONG)&(P->u));
	off_w=(UWORD)( (ULONG)&(P->w) - (ULONG)&(P->u));
	W3D_VertexPointer(context,VertexPointer,stride,W3D_VERTEX_F_F_F, 0);
	W3D_TexCoordPointer(context,TexCoordPointer,stride,0,off_v,off_w,W3D_TEXCOORD_NORMALIZED);
	W3D_ColorPointer(context,ColorPointer,stride,W3D_COLOR_UBYTE ,W3D_CMODE_RGBA,0);

        W3D_LockHardware(context);		
		W3D_BindTexture(context,0,tex);
		W3D_DrawArray(context,W3D_PRIMITIVE_TRISTRIP,0,4);
	W3D_UnLockHardware(context);
		
}
and if you call it with a NULL parameter instead of a texture pointer (tex), you hang the system. No problem if it is 68k code.
Documentation says that you can "unbind" a texture with W3D_BindTexture(context,0,NULL).

Of course, you can bridge the code checking if a NULL is given to "tex", or do another function for drawing something without textures.

MiniGL lib has nothing like W3D_BindTexture, it changes the "context" of Warp3D directly (if I understand what I read on it). Still the code checks for those NULL parameters, but....



Related to that, all code made works on.....Morphos 1.4 powerup (the old trick to copy all W3D libraries) (a better check for unaligned data?)

Any ideas ? Somebody fixed that ? ( proper envs: for W3D?, its W3DPPC.library or W3D_PermediaPPC.library ?, ugly MiniGL ?).

Cheers.

Last edited by Cowcat; 04 December 2013 at 13:39.
Cowcat is offline  
 
Page generated in 0.06584 seconds with 11 queries