From: "Wim Cools" Newsgroups: comp.os.msdos.djgpp References: <002901c02e78$39781c60$4a7536ca AT a> Subject: Re: BMP PROBLEM Lines: 176 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0013_01C02EE3.3917F860" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: Date: Thu, 05 Oct 2000 13:45:01 GMT NNTP-Posting-Host: 212.83.89.103 X-Complaints-To: abuse AT chello DOT nl X-Trace: nlnews00.chello.com 970753501 212.83.89.103 (Thu, 05 Oct 2000 12:45:01 GMT) NNTP-Posting-Date: Thu, 05 Oct 2000 12:45:01 GMT Organization: chello broadband To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com This is a multi-part message in MIME format. ------=_NextPart_000_0013_01C02EE3.3917F860 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > Hi,=20 i am sorry for having posted this message here, (since this is a = djgpp mailing list & not BGI ) but i got a problem which only =20 you guys can solve out.=20 I am making a BMP editor for our school project in TC++30. I managed to get 640x480x256color working using interrupts.=20 Well when i used 16 color mode MOUSE was visible, Now when i = switched to 256 color mode MOUSE is not visible even after calling int = 33h for showing mouse ptr. Anybody has a slight idea whats happenning = 'cos i am new to grafix stuff. How do i correct this error. Thanx in advance. Siddhartha. =20 --------------------------------------------------------- The problem is that the mouse driver does not support mouse cursors = (like the standard white arrow and the ascii character in textmode) in = VESA modes (like the 640x480x256). You'll have to play with int 33h a = bit to make this work. For example you could hook interrupt 31 and then, = when interrupt 33 is called with ax =3D 0x1 (show mouse) let your = program show a graphic mouse cursor (you can use putpixel to draw your = own cursor and you could use 256 colors in your cursor. But also notice = that the BGI putpixel is not very fast so don't make your mouse cursor = too big). If you aren't familiar with interrupts you could also do this = in an easier way. Create a program like this example: int mouse_cursor_image_array[100] =3D=20 {0,0,0,0,0 .... create your own mouse cursor picture here ..... }; void DrawMouseCursor(int x, int y) { for (int i =3D 0; i < 10; i++) for (int m =3D 0; i < 10; m++) putpixel(i,m,mouse_cursor_image_array[i*10+m]);=20 }
MouseOn(); // Call 0x33, ax =3D 1; Since this will not show the = mouse cursor we will draw it by hand.... while (!kbhit()) { GetCurrentMouseCoordinates(&x, &y); DrawMouseCursor(x, y); DoSomeThingElseUseful(); // the rest of your program :) } ..... The problem with the last solution is that you have to do everything = within the loop or your mouse cursor will not be drawn. I know it's a = kind of weird solution but it works. Q'plaH (good luck) ------=_NextPart_000_0013_01C02EE3.3917F860 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 
 
> Hi,=20
 
    i am sorry for having posted this message = here, (since=20 this is a djgpp mailing list & not BGI ) but i got a problem which = only     
     you guys can solve out. =
 
I am making a BMP editor for our school project in TC++30.
I managed to get 640x480x256color working using interrupts. =
Well     when i used 16 color mode MOUSE was = visible, Now=20 when i switched to 256 color mode MOUSE is not visible even after=20 calling int 33h  for showing mouse ptr. Anybody has a = slight=20 idea whats happenning 'cos i am new to grafix stuff. How do i correct = this=20     error.
 
    Thanx in advance.
 
    Siddhartha.
   
---------------------------------------------------------
 
The problem is that the mouse driver does not support mouse = cursors (like=20 the standard white arrow and the ascii character in textmode) in VESA = modes=20 (like the 640x480x256). You'll have to play with int 33h a bit to make = this=20 work. For example you could hook interrupt 31 and then, when interrupt = 33 is=20 called with ax =3D 0x1 (show mouse) let your program show a graphic = mouse cursor=20 (you can use putpixel to draw your own cursor and you could use 256 = colors in=20 your cursor. But also notice that the BGI putpixel is not very fast so = don't=20 make your mouse cursor too big). If you aren't familiar with = interrupts you=20 could also do this in an easier way. Create a program like this=20 example:
 
int mouse_cursor_image_array[100] =3D =
{0,0,0,0,0 .... create your own mouse cursor = picture here=20 ..... };
 
void DrawMouseCursor(int x, int y)
{
  for (int i =3D 0; i < 10; = i++)
    for (int m =3D 0; i <=20 10; m++)
       =20 putpixel(i,m,mouse_cursor_image_array[i*10+m]); 
}
 
<main function>
MouseOn();     // Call 0x33, ax =3D = 1; Since=20 this will not show the mouse cursor we will draw it by = hand....
while (!kbhit())
{
     GetCurrentMouseCoordinates(&x,=20 &y);
     DrawMouseCursor(x, = y);
     DoSomeThingElseUseful(); = // the=20 rest of your program :)
}
.....
 
 
The problem with the last solution is that you have to do = everything=20 within the loop or your mouse cursor will not be drawn. I know it's a = kind of=20 weird solution but it works.
 
Q'plaH (good luck)
------=_NextPart_000_0013_01C02EE3.3917F860--