Welcome, Guest. Please login or register.

Author Topic: How to use BltBitmaprast port or other like it  (Read 4023 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline yssingTopic starter

  • Hero Member
  • *****
  • Join Date: Apr 2002
  • Posts: 1521
    • Show all replies
    • http://www.yssing.org
How to use BltBitmaprast port or other like it
« on: March 06, 2003, 09:25:37 AM »
Hi

I seem to have a problem with this.
If I use AllocBitMap() to alloc the bitmap I use to store image data.
And then use BltBitMap() my puter crashes. I am sure I am doing some thing wrong.
My question is this : Does any one have an example on how to use AllocBitMap() with BltBitMap()

Hope you guys can help...

 

Offline yssingTopic starter

  • Hero Member
  • *****
  • Join Date: Apr 2002
  • Posts: 1521
    • Show all replies
    • http://www.yssing.org
Re: How to use BltBitmaprast port or other like it
« Reply #1 on: March 06, 2003, 09:46:24 AM »
Here is my code....

struct RastPort     *rastport1 = NULL;
struct BitMap       *bitmap = NULL;
struct BitMap       *mitbitmap = NULL;
BPTR m;
 
rastport1 = Mywindow->RPort;


  mitbitmap = AllocBitMap(640,480,8,BMF_MINPLANES|BMF_DISPLAYABLE,rastport1->BitMap);
  m = Open("GFX/game_menu", MODE_OLDFILE);
  Read(m, menuraw, 307200);
  Close(m);
  menu.ImageData = menuraw;

BltBitMap(mitbitmap,0,0,rastport1->BitMap,0,0,640,480,0xC0,0xff,NULL);

Should be it...
 

Offline yssingTopic starter

  • Hero Member
  • *****
  • Join Date: Apr 2002
  • Posts: 1521
    • Show all replies
    • http://www.yssing.org
Re: How to use BltBitmaprast port or other like it
« Reply #2 on: March 06, 2003, 10:11:30 AM »
Nope I am not using CGFX.
Just plain WB....
I am trying to keep it as HW independant as possible
 

Offline yssingTopic starter

  • Hero Member
  • *****
  • Join Date: Apr 2002
  • Posts: 1521
    • Show all replies
    • http://www.yssing.org
Re: How to use BltBitmaprast port or other like it
« Reply #3 on: March 06, 2003, 10:49:09 AM »
Well It does not crash anymore :-)

But It does only display a grey screen :-(

But thank you very much.. I never did think about that friend bitmap and the way I loaded data.
 

Offline yssingTopic starter

  • Hero Member
  • *****
  • Join Date: Apr 2002
  • Posts: 1521
    • Show all replies
    • http://www.yssing.org
Re: How to use BltBitmaprast port or other like it
« Reply #4 on: March 06, 2003, 10:56:13 AM »
Well I do have my own screen and palette.
I am, in my program, using DrawImage, which works, and does a good job. but, it is rather slow.
And cannot blit with transparent color.
But I think I can continue now :-)