Welcome, Guest. Please login or register.

Author Topic: lame problem with warp3d devel  (Read 2416 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline kas1eTopic starter

lame problem with warp3d devel
« on: December 24, 2004, 03:57:09 PM »
hi 2 all.
i have very funny problem in warp3d develop. i can't draw a line :)
So:

1. W3D_RequestModeTags for Mode it
2. OpenScreenTags for open screen
3. init bitmap for w3d_context (bm=screen->RastPort.BitMap)
4. create context by W3D_CreateContextTags
well, i check on error result from this func, and
i have W3D_Success.
5. Problem here :) I try:

line.v1.x = 0;
line.v1.y = 0;
line.v2.x = 100;
line.v2.y = 400;

res = W3D_DrawLine(context,&line);
if(res==W3D_SUCCESS){printf("we draww a line\n");};


I do not W3D_LockHardware, becouse use W3D_CC_FAST, TRUE in context.
So, if i run it, i have:
"create context succesul"
"we draw a line"
and nothink happening on my screen. I try use W3D_SetDrawRegion, W3D_SetCurrentColor, W3D_SetState(indirect) .. any case - i do not view my line :( Why ? (But W3D_DrawLine said "ok" as you can see).

thanks fro answers
 

Offline EntilZha

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 131
    • Show only replies by EntilZha
    • http://www.hyperion-entertainment.com
Re: lame problem with warp3d devel
« Reply #1 on: December 24, 2004, 10:51:26 PM »
Why do you think that you don't need to call W3D_LockHardware because of W3D_CC_FAST ? This wil only allow the driver to modify your vertex structures, and I think only the Virge driver actually makes use of this.

You still need to call W3D_LockHardware. The point of W3D_Lockhardware is to ensure that the bitmaps used for textures and the drawing region are in display memory, and can't move.

I should probably warn you that not all drivers can draw lines. You can use W3D_Query to check if it can draw lines by querying for W3D_Q_DRAW_LINE.

If it can, but you still don't get a line, then it's a bug... If it returns W3D_SUCCESS, then it's definitely a bug since the function should inform you that the context isn't locked...

What graphics card are you using ?
- Thomas
Avatar by Karlos
 

Offline kas1eTopic starter

Re: lame problem with warp3d devel
« Reply #2 on: December 25, 2004, 01:17:49 PM »
I do not using LockHardware now, becouse it HALT my system. It strange, look at this:

context=W3D_CreateContext(&CError,
   W3D_CC_MODEID,      MODEID,
   W3D_CC_BITMAP,      bm,
   W3D_CC_YOFFSET,     0,
   W3D_CC_DRIVERTYPE,  W3D_DRIVER_BEST,
TAG_DONE);

line.v1.x=0;line.v1.y=0;
line.v2.x=100;line.v2.y=300;

res=W3D_LockHardware(context);
if(res==W3D_SUCCESS){printf("success\n");};
if(res==W3D_NOTVISIBLE){printf("bitmap problem\n");};

W3D_DrawLine(context,&line);

W3D_UnLockHardware(context);

Delay(100);
W3D_DestroyContext(context);

if i running it, i do not view my line, system HALT and only reboot can help :) I do somethinks wrong ?

So, i using indirect mode now .. And can draw a line, but problem with W3D_Query. I mean i can draw line, but W3D_Query(context,W3D_Q_DRAW_LINE,W3D_FMT_CLUT); said me "w3d_not_supported". But next string is a W3D_DrawLine and it work :)


I am use Voodoo3 in my mediator on a1200. All samples from Warp4.2 working.

 

Offline EntilZha

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 131
    • Show only replies by EntilZha
    • http://www.hyperion-entertainment.com
Re: lame problem with warp3d devel
« Reply #3 on: December 25, 2004, 10:05:00 PM »
Quote
I do not using LockHardware now, becouse it HALT my system. It strange, look at this:


Without LockHardware, you can't use 3D graphics. One thing to look out for is anything that would do a graphics operation on the screen. You call "printf". You can't do that in LockHardware, because amoung other things, LockHardware calls the CyberGraphics/Picasso96 equivalent of LockBitMap. LockBitmap is global, you can only lock one bitmap at a time. printf and the subsequent output in the shell will also call LockBitMap, which will lock up because you already hold another lock.

The only possibility to get around this is not to use printf or other functions during a W3D_LockHardware
- Thomas
Avatar by Karlos
 

Offline kas1eTopic starter

Re: lame problem with warp3d devel
« Reply #4 on: December 25, 2004, 10:55:04 PM »
thanks for answers :)
ok, printf get out, and lockhardware was ok.

I have check by W3D_Query on all possibly variants, and is strange (?), but my voodoo3 said 'can't supported draw a line, can't supported draw a point". But i can draw a line in indirect and direct mode :) where is true ?:)
 

Offline EntilZha

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 131
    • Show only replies by EntilZha
    • http://www.hyperion-entertainment.com
Re: lame problem with warp3d devel
« Reply #5 on: December 26, 2004, 11:38:23 AM »
It definitely can't draw points. The Voodoo chip itself can't draw line, either, so initially, it wasn't implemented. Later on, we implemented lines by drawing a thin triangle strip, but obviously forgot to update the query table. Thanks for the pointer.
- Thomas
Avatar by Karlos
 

Offline kas1eTopic starter

Re: lame problem with warp3d devel
« Reply #6 on: December 26, 2004, 12:17:20 PM »
"Later on, we implemented" - "we" mean we the Elbox ?:)

btw, where is the best way for create 640x480x16bit bitmap ?
i have 040/33 and want fast fading/scrolling/etc. can i do it
with warp3d ? For example, load picture as texture, upload to
memory, lockhardware and put picture to screen (as texture).
I hope it can be fast ? I tryed this by cybergraphics.library
(by WritePixelArray) and have slow speed with scrolling these screen and fading too..
 

Offline Crumb

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1786
  • Country: 00
    • Show only replies by Crumb
    • http://cuaz.sourceforge.net
Re: lame problem with warp3d devel
« Reply #7 on: December 26, 2004, 02:39:09 PM »
Voodoo3 can only use 256x256 textures.
The only spanish amiga news web page/club: Club de Usuarios de Amiga de Zaragoza (CUAZ)
 

Offline EntilZha

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 131
    • Show only replies by EntilZha
    • http://www.hyperion-entertainment.com
Re: lame problem with warp3d devel
« Reply #8 on: December 27, 2004, 01:20:03 AM »
Quote

kas1e wrote:
"Later on, we implemented" - "we" mean we the Elbox ?:)


"We" means we, as in Hans-Jörg and me. The Warp3D drivers are never done by Elbox.

Quote

btw, where is the best way for create 640x480x16bit bitmap ?
i have 040/33 and want fast fading/scrolling/etc. can i do it
with warp3d ?


No, Warp3D can't allocate bitmaps. You need to allocate them via graphics.library, and make them a friend bitmap of your screen's or window's bitmap.

Quote

 For example, load picture as texture, upload to
memory, lockhardware and put picture to screen (as texture).
I hope it can be fast ? I tryed this by cybergraphics.library
(by WritePixelArray) and have slow speed with scrolling these screen and fading too..


Forget WritePixelArray for such things. If you need to write an offscreen bitmap to the screen or a window, use ClipBlit, or Warp3D  :-D It should be pretty fast with the Voodoo...

Note, though, as Crumb already said, that the Voodoo 3 can only do 256x256 textures... Yu can query that as well via W3D_Query... The P2, for example, supports up to 2048x2048.

If you need "odd" formats, create multiple textures, and draw them as "tiles", i.e. cut the picture into 256x256 blocks, and render them to the screen as 256x256 pixel quads or triangle fans.
- Thomas
Avatar by Karlos