File: cs_259.html

package info (click to toggle)
crystalspace 0.94-20020412-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 62,276 kB
  • ctags: 52,843
  • sloc: cpp: 274,783; ansic: 6,608; perl: 6,276; objc: 3,952; asm: 2,942; python: 2,354; php: 542; pascal: 530; sh: 430; makefile: 370; awk: 193
file content (200 lines) | stat: -rw-r--r-- 8,500 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created by texi2html 1.64 -->
<!-- 
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
 
-->
<HTML>
<HEAD>
<TITLE>Crystal Space: OS2 DIVE Features</TITLE>

<META NAME="description" CONTENT="Crystal Space: OS2 DIVE Features">
<META NAME="keywords" CONTENT="Crystal Space: OS2 DIVE Features">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">

</HEAD>

<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">

<A NAME="SEC625"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_258.html#SEC624"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_260.html#SEC626"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_248.html#SEC612"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_257.html#SEC623"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_262.html#SEC628"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<HR SIZE=1>
<H4> 8.1.2.2 DIVE Features </H4>
<!--docid::SEC625::-->
<P>

Here is a short list of implementation features related to DIVE:
</P><P>

<UL>
<LI>
DIVE contexts can be created with following pixel formats:
<P>

<UL>
<LI>
<CODE>FOURCC_LUT8</CODE>
<LI>
<CODE>FOURCC_R565</CODE>
<LI>
<CODE>FOURCC_R664</CODE>
<LI>
<CODE>FOURCC_R555</CODE>
<LI>
<CODE>FOURCC_BGR4</CODE>
</UL>
<P>

If you use `<SAMP>DEPTH=8</SAMP>' in Crystal Space configuration file, or use
`<SAMP>-depth 8</SAMP>' command-line parameter, Crystal Space will start with
`<SAMP>FOURCC_LUT8</SAMP>' pixel format, regardless of what PM screen depth you
have.  If you choose 15, 16 or 32 bit color depth, the format will be chosen
as follows:
</P><P>

<UL>
<LI>
If you selected 32-bit mode, and current screen depth is 32 bits, current
pixel format is used.  See the following note for more information.
<P>

<LI>
If screen pixel depth is `<SAMP>FOURCC_R565</SAMP>', `<SAMP>FOURCC_R664</SAMP>',
`<SAMP>FOURCC_R555</SAMP>', that pixel format is used.
<P>

<LI>
If you use `<SAMP>-depth 15</SAMP>' or `<SAMP>DEPTH=15</SAMP>' parameters, `<SAMP>FOURCC_R555</SAMP>'
pixel format will be used.
<P>

<LI>
Otherwise the list of DIVE supported pixel formats is scanned.  The most
wanted mode is R5-G6-B5 mode, if it is not available R6-G6-B4 mode is choosen,
if it is not available, R5-G5-B5 mode is choosen.  If no 16- or 15-bit mode is
available, code falls back to 256-color mode.
</UL>
<P>

<EM>Note</EM>: Due to a bug (or a misimplemented feature, to say so) in OS/2
DIVE library, you can't use 32-bit modes with the stock `<TT>DIVE.DLL</TT>'
library.  You have to patch it first so that it won't reject `<SAMP>BGR4</SAMP>' pixel
format when creating image buffers.
</P><P>

<STRONG>Warning</STRONG>: This is a <EM>Bad Fix</EM> however I didn't have any other
choice.  It works for me with Matrox Mystique and Matrox Millenium ][ video
cards, but I don't guarantee it will work for you:
</P><P>

Go to `<TT>\MMOS2\DLL</TT>'. Take the `<TT>DIVE.DLL</TT>' library. Unpack it, if it
is packed (`<SAMP>lxlite /x dive.dll</SAMP>'). Now find the following sequence of
bytes inside it:
</P><P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>83 C2 08 41 83 F9 [10]
</pre></td></tr></table></P><P>

This sequence happens only once in my `<TT>DIVE.DLL</TT>'; I hope this is true for
your `<TT>DIVE.DLL</TT>' as well.  Now change the `<SAMP>10</SAMP>' that I took into
square brackets with `<SAMP>16</SAMP>'.  That's all.
</P><P>

Note that you will likely get wrong results if your current pixel format is
<EM>not</EM> low-endian 32-bit (i.e. `<SAMP>BGR4</SAMP>').  That's not my fault.
</P><P>

<LI>
DIVE windows can be rescaled to arbitrary sizes.  Rescaling is done
automatically by DIVE, as well as color conversion.  Note that if
EnDIVE is available, you better use the same pixel format as your PM
does, since most cards (my Matrox Mystique, for example) supports in hardware
<EM>either</EM> color conversion <EM>or</EM> rescaling, but not both (although I
can be wrong here, but that was my impression).
<P>

<LI>
Although DIVE does not (transparently) allow blitting only a portion of
backbuffer to screen, there is still a solution.  The key is to call each time
<CODE>DiveSetupBlitter()</CODE> with same parameters as usual, but clipping first
all rectangles returned by <CODE>GpiQueryRegionRects()</CODE> against the rectangle
you want to update.  Look in `<TT>libDIVE.cpp</TT>'
(<CODE>diveWindow::SetupBlitter</CODE>) for more details.
<P>

<LI>
Although documentation states that <CODE>DiveSetupBlitter()</CODE> is a longplay
operation, I think if you should update only a small part of screen it is
still faster to use it (for example, CSWS mostly needs to update only the
portion of screen around mouse cursor, <A HREF="cs_143.html#SEC311">6.6 Crystal Space Windowing System (CSWS)</A>).  <CODE>DiveSetupBlitter()</CODE>
is not called multiple times if update region does not change, so if you
always call <CODE>Graphics2D::Print()</CODE> with a constant argument (or
`<SAMP>NULL</SAMP>' for entire area), it won't be called more often than in the
"classic" situation.
<P>

<LI>
There is an <EM>almost full-screen</EM> DIVE mode of operation available.
To activate/deactivate it you can press <KBD>ALT</KBD>-<KBD>HOME</KBD> (like in DOS
windows).  In this mode window is resized so that window borders and window
title will fall outside of physical screen, and DIVE window occupies
entire screen.  The bad side is that you get not too high frame rates in this
mode (for example, on Matrox Mystique a window 320x200x256 rescaled to
1152x864x64K can be updated only about 15 times per second).
<P>

<LI>
The system menu on Crystal Space window is replaced by a more
application-specific menu.  There are some useful options there (also
available through hot-keys, for example <KBD><KBD>CTRL</KBD>-<KBD>ALT</KBD>-1</KBD> rescales
window to 1:1 scale, <KBD><KBD>CTRL</KBD>-<KBD>ALT</KBD>-2</KBD> to 2:1, and so on).  The
menu definition is contained in `<TT>libDIVE.rc</TT>'.  If you need some
additional entries, you can add them directly to resource file.
</UL>
<P>

<EM>Note</EM>: If you're running 16 BPP or 32 BPP on Matrox cards,
make sure you disabled the "Enable EnDIVE in 16 BPP and 32 BPP"
checkbox in the Matrox settings notebook.  This is a real performance killer.
(FPS drops twice on my Matrox II AGP, for example.)
</P><P>

<A NAME="OS2 Input"></A>
<HR SIZE=1>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_258.html#SEC624"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_260.html#SEC626"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_248.html#SEC612"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_257.html#SEC623"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_262.html#SEC628"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>  
<FONT SIZE="-1">
This document was generated

using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>

</BODY>
</HTML>