I have been going through a few graphics tutorials which I found @ http://www-scf.usc.edu/~akotaobi.
If you have done the same tuts, then maybe you can help me.
I have aproblem with the following function in that it always fails because the sizeof(inf) is always less than _go32_info_block.size_of_transfer_buffer.
Code:
void get_svga_modeinfo (int mode, modeinfo& inf) {
// Retrieve data for the screenmode and stuff it in the modeinfo struct.
__dpmi_regs r;
assert(sizeof(inf) < _go32_info_block.size_of_transfer_buffer);
r.x.ax = 0x4F01; // Mode info retrieval function.
r.x.cx = mode;
r.x.di = __tb & 0x0F;
r.x.es = (__tb >> 4) & 0xFFFF;
__dpmi_int(0x10, &r);
dosmemget(__tb, sizeof(inf), &inf);
// Save some info to avoid redundant calculations.
maxx = inf.XResolution;
maxy = inf.YResolution;
bits_per_pixel = inf.BitsPerPixel;
bytes_per_pixel = bits_per_pixel * 8;
wingranularity = inf.WinGranularity;
}
I printed the values for both and this is what I get :
sizeof( inf ) = 256
_go32_info_block.size_of_transfer_buffer = 16384
What could it be?