Mail Archives: djgpp/2000/10/05/11:55:10
From: | "Wim Cools" <w DOT cools AT chello DOT nl>
|
Newsgroups: | comp.os.msdos.djgpp
|
References: | <002901c02e78$39781c60$4a7536ca AT a>
|
Subject: | Re: BMP PROBLEM
|
Lines: | 176
|
MIME-Version: | 1.0
|
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: | <xB%C5.48689$Sb1.776187@nlnews00.chello.com>
|
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
}
<main function>
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV> </DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV> </DIV>
<DIV>> Hi,=20
<DIV> </DIV>
<DIV> 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 </DIV>
<DIV> you guys can solve out. =
</DIV>
<DIV> </DIV>
<DIV>I am making a BMP editor for our school project in TC++30.</DIV>
<DIV>I managed to get 640x480x256color working using interrupts. =
</DIV>
<DIV>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.</DIV>
<DIV> </DIV>
<DIV> Thanx in advance.</DIV>
<DIV> </DIV>
<DIV> Siddhartha.</DIV>
<DIV> </DIV>
<DIV>---------------------------------------------------------</DIV>
<DIV> </DIV>
<DIV>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:</DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>int mouse_cursor_image_array[100] =3D =
</FONT></DIV>
<DIV><FONT size=3D2>{0,0,0,0,0 .... create your own mouse cursor =
picture here=20
..... };</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>void DrawMouseCursor(int x, int y)</FONT></DIV>
<DIV><FONT size=3D2>{</FONT></DIV>
<DIV><FONT size=3D2> for (int i =3D 0; i < 10; =
i++)</FONT></DIV>
<DIV><FONT size=3D2> for (int m =3D 0; i <=20
10; m++)</FONT></DIV>
<DIV><FONT size=3D2> =20
putpixel(i,m,mouse_cursor_image_array[i*10+m]); </FONT></DIV>
<DIV><FONT size=3D2>}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2><main function></FONT></DIV>
<DIV><FONT size=3D2>MouseOn(); // Call 0x33, ax =3D =
1; Since=20
this will not show the mouse cursor we will draw it by =
hand....</FONT></DIV>
<DIV>while (!kbhit())</DIV>
<DIV>{</DIV>
<DIV> GetCurrentMouseCoordinates(&x,=20
&y);</DIV>
<DIV><FONT size=3D2> DrawMouseCursor(x, =
y);</FONT></DIV>
<DIV><FONT size=3D2> DoSomeThingElseUseful(); =
// the=20
rest of your program :)</FONT></DIV>
<DIV>}</DIV>
<DIV><FONT size=3D2>.....</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>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.</DIV>
<DIV> </DIV>
<DIV>Q'plaH (good luck)</DIV></DIV></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0013_01C02EE3.3917F860--
- Raw text -