1vga_ext_set(3) Svgalib User Manual vga_ext_set(3)
2
3
4
6 vga_ext_set - set and query several extended features
7
9 #include <vga.h>
10
11 int vga_ext_set(unsigned what, ...);
12
13
15 sets and several extended features. Before trying to call vga_ext_set()
16 you should check if it is available in vga_getmodeinfo(3) for compati‐
17 bility with old svgalib versions. In addition, the availability of cer‐
18 tain features will depend on the current graphics mode.
19
20 However, the VGA_EXT_PAGE_OFFSET and VGA_EXT_FONT_SIZE features are
21 features of the base module of svgalib and are always available if your
22 version of svgalib supports them. Actually the result of vga_getmode‐
23 info(3) shows the availability of enhancements of vga_ext_set() in the
24 given SVGA graphics mode. Hence, these base features may be supported
25 even if svgalib does not admit it. Since version 1.2.13 you can check
26 vga_getmodeinfo(TEXT) to see if basic vga_ext_set() functionality is
27 available. The VGA_EXT_PAGE_OFFSET and VGA_EXT_FONT_SIZE calls are then
28 available in any mode even if vga_getmodeinfo(3) states that you should
29 not call vga_ext_set() at all.
30
31 As of now, the following calls are defined:
32
33 Query availability of features
34 vga_ext_set(VGA_EXT_AVAILABLE, VGA_AVAIL_SET)
35 returns an int with the i-th bit set if i is a valid what param‐
36 eter for vga_ext_set().
37
38 vga_ext_set(VGA_EXT_AVAILABLE, VGA_AVAIL_ACCEL)
39 returns an integer with the i-th bit set if i is a valid what
40 parameter for vga_accel(3). For nicer code, the following inte‐
41 gers are predefined to have a bit set in the right position:
42
43 ACCELFLAG_FILLBOX, ACCELFLAG_SCREENCOPY, ACCELFLAG_PUTIMAGE,
44 ACCELFLAG_DRAWLINE, ACCELFLAG_SETFGCOLOR, ACCELFLAG_SETBGCOLOR,
45 ACCELFLAG_SETTRANSPARENCY, ACCELFLAG_SETRASTEROP, ACCELFLAG_PUT‐
46 BITMAP, ACCELFLAG_SCREENCOPYBITMAP, ACCELFLAG_DRAWHLINELIST,
47 ACCELFLAG_SETMODE, and ACCELFLAG_SYNC.
48
49 vga_ext_set(VGA_EXT_AVAILABLE, VGA_AVAIL_ROP)
50 returns an integer as VGA_AVAIL_ACCEL does, but this time list‐
51 ing the vga_accel(3) operations which obey a
52 vga_accel(ACCEL_SETRASTEROP, ...) setting.
53
54 vga_ext_set(VGA_EXT_AVAILABLE, VGA_AVAIL_TRANSPARENCY)
55 returns an integer as VGA_AVAIL_ACCEL does, but this time list‐
56 ing the vga_accel(3) operations which obey a
57 vga_accel(ACCEL_SETTRANSPARENCY, ...) setting.
58
59 vga_ext_set(VGA_EXT_AVAILABLE, VGA_AVAIL_ROPMODES)
60 returns an integer with the i-th bit set if i is a valid mode
61 parameter for a vga_accel(ACCEL_SETRASTEROP, mode) call. For
62 example:
63
64 if (vga_ext_set(VGA_EXT_AVAILABLE, VGA_AVAIL_ROPMODES) & (1 <<
65 ROP_XOR))
66 vga_accel(ACCEL_SETRASTEROP, ROP_XOR);
67 else
68 /* do something else */
69
70
71 vga_ext_set(VGA_EXT_AVAILABLE, VGA_AVAIL_TRANSMODES)
72 returns an integer with the i-th bit set if i is a valid mode
73 parameter for a vga_accel(ACCEL_SETTRANSPARENCY, mode, ...)
74 call. The function lists only the supported enable functions
75 (currently ENABLE_TRANSPARENCY_COLOR and ENABLE_BITMAP_TRANS‐
76 PARENCY). It is assumed the corresponding disable functions
77 will then exist as well.
78
79 vga_ext_set(VGA_EXT_AVAILABLE, VGA_AVAIL_FLAGS)
80 returns an int with one bit on/off flags. Bits that are set are
81 supported refer to special features which can be enabled in the
82 current mode.
83
84
85 Operations with one bit flags
86 A certain mode might have a special feature which can be turned on or
87 off by the applications. These functions allow to handle such features.
88
89 You can always set flags, and their settings are remembered if not sup‐
90 ported in the current mode. This is to avoid problems when switching
91 VC's.
92
93
94 vga_ext_set(VGA_EXT_SET, int bitflags)
95 set all flags that are set in bitflags, do not touch any other
96 flags. Returns previous setting of all flags.
97
98 vga_ext_set(VGA_EXT_CLEAR, int bitflags)
99 clear all flags that are set in bitflags, do not touch any other
100 flags. Returns previous setting of all flags.
101
102 vga_ext_set(VGA_EXT_RESET, int bitflags)
103 set all flags to the corresponding bits of bitflags. Returns
104 previous setting of all flags.
105
106
107 One bit flags for special features
108 As of now, we only support
109
110 VGA_CLUT8
111 which is set by calling vga_ext_set(VGA_EXT_SET, VGA_CLUT8).
112 This makes the color lookup table for 16 and 256 color lookup
113 table modes work with 8 bit per red, green, blue part instead of
114 the ordinary 6 bits.
115
116 As of now this feature is only availabl for Mach32 cards with
117 type 2 DAC's. 8 bit per red, green, blue wide in all (even VGA)
118 256 color modes. This mean, however, that all calls to vga_set‐
119 palette(3) and vga_setpalvec(3) need to be adjuste accordingly
120 as well as that the interpretation of the return values of
121 vga_getpalette(3) and vga_getpalvec(3) changes.
122
123 The testaccel(6) demos makes use of this to show a smooth 256
124 blue shades scale.
125
126
127 Miscanellous features
128 vga_ext_set(VGA_EXT_PAGE_OFFSET, int offset)
129 for all following vga_set*page(n) calls (even those implicitly
130 done by svgalib drawing functions) do vga_set*page(n + offset)
131 instead. This is very nice for drawing in an offscreen area.
132 However, it requires the mode being able to use more than one
133 page at all as well as not having called vga_setlinearaddress‐
134 ing(3).
135
136 A better approach would be to just use higher y values for all
137 draw operations to have them end up in offscreen regions that
138 may be displayed later (cf. vga_setdisplaystart(3)).
139
140 The previously set value for VGA_EXT_PAGE_OFFSET (which defaults
141 to 0 at startup) is returned.
142
143
144 vga_ext_set(VGA_EXT_FONT_SIZE, int size)
145 sets the size of the buffer which the application passes to
146 vga_gettextfont(3) and vga_puttextfont(3). Old versions of
147 svgalib used a fixed size of 8192 which is still the default.
148 Newer versions of svgalib use a larger size internally to prop‐
149 erly support the extended font capabilities of newer kernels.
150
151 Calling vga_ext_set(VGA_EXT_FONT_SIZE, 0) returns the size of
152 the internal buffers of svgalib. It is recommended to use this
153 (or a larger size) for any font (re)storing application. If this
154 differs from the size of the applications buffers set vga_get‐
155 textfont(3) and vga_puttextfont(3) truncate and zero-pad all
156 buffers accordingly.
157
158 Otherwise the previously set buffer size is returned.
159
160
162 svgalib(7), vgagl(7), libvga.config(5), accel(6), testaccel(6),
163 vga_setpalette(3), vga_setpalvec(3), vga_getpalette(3), vga_get‐
164 palvec(3), vga_setlinearaddressing(3), vga_setdisplaystart(3), vga_set‐
165 page(3), vga_setreadpage(3), vga_setwritepage(3), vga_gettextfont(3),
166 vga_puttextfont(3).
167
168
170 This manual page was edited by Michael Weller <eowmob@exp-math.uni-
171 essen.de>. The exact source of the referenced function as well as of
172 the original documentation is unknown.
173
174 It is very likely that both are at least to some extent are due to Harm
175 Hanemaayer <H.Hanemaayer@inter.nl.net>.
176
177 Occasionally this might be wrong. I hereby asked to be excused by the
178 original author and will happily accept any additions or corrections to
179 this first version of the svgalib manual.
180
181
182
183Svgalib (>= 1.2.11) 27 July 1997 vga_ext_set(3)