OpenGL arbirtary display start address
My name is Julio Menezes and I leave in Brazil.
I need some help.
I have developed an 3D stereo system with LCD glasses
that uses arbirtary display start address.
Is it possible with OpenGL or SDL ?
thaks in advanced,
happy 2005,
[]s julio menezes
-------------------------------------------------------
I'm trying to port my 32bitDOS WATCOM C Stereo
application
with LCDglasses + VESA bios calls to GNU/LINUX.
My application require arbitrary LEFT RIGHT display
start address (hardware scroll).
Not interlaced G1024x768x256 and a 120Hz capable
Monitor (flicker free).
It uses an old Diamond card with 2MB. Two pages
running on a 233Mhz CPU.
My system makes direct IO to set the
DisplayStartAddress on a S3 Card.
I need this because it must runs from inside an
Hardware Interrupt Routine.
REAL MODE x PROTECTED MODE, 16 BITS BIOS ON A 32
BITS PROCESSOR. It stinks...
How it works:
I use two separate video pages, which can be
displayed on the screen independently.
These can contain two views (PHOTOS) of a scene,
taken from slightly different viewpoints. These
are displayed alternately on the screen, in sync
with a pair of "chopper glasses",
to give a 3D effect.
/* HOW IT WAS UNDER MS_DOS + WATCOM C:
//-------------------------------------------------------------
JM 10/10/97
// CHIP S3 (Diamond Stealth), 2MB memory board:
(y=1280+768)=2048
// Problem: Can't call VESA functions from inside
INTERRUPT routine.
// FLIP. LEFT: y=0; RIGHT: y = +-768. 0 <= y <
(2048 - 768)
// Right page must move a little UP and DOWN to adjust
with the LEFT.
// 3d4h index 38h (R/W): Extensions Enable
// bit 0-7 Writing 48h to this register enables the
extended registers,
// writing 0 disables them.
// 3d4h index 39h (R/W): Extensions Enable 2
// bit 0-7 Write A5h to this register to unlock
extensions.
INT16 Diamond_DisplayStart(INT16 y) // y = page
begining
{
#define CRTC_IND 0x3D4
outpw(CRTC_IND,0x4838); // unlock S3 Chip
extentions
outpw(CRTC_IND,0xA539); // writing 0xA5
outpw(CRTC_IND,0x0069 | (y & 0xFF00));
outpw(CRTC_IND,0x000c | ((y & 0x00FF) << 8));
outpw(CRTC_IND,0x000d);
return(y);
} // Diamond_DisplayStart
//--------------------------------------------------------------------------
#define LPT_ADDRESS 0x378
//-------------------------------------------------------------
JM 10/10/97
// Interrupt: take IRQ from LPT, swap LCD lens and
page flipping.
// Vertical Sync Pulse from Monitor inserted on LPT.
// VESA Display Data Channel (DDC) Standard. 15-pin
mini Sub-D:
// VESA Pins:
// 13 Horzontal Sync
// 14 Vertical Sync
//
void __interrupt __far iNovaIntChinon(__CPPARGS)
{
// 0x379 read pin 12 to know the open lens of the LCD
glasses 0=Left 1=Right
Chinon_.LR = (INT16)((inp(LPTADDRESS + 1) & 0x0020)
>> 5); //0 or 1
if (Chinon_.LR)
Diamond_DisplayStart(768 + ChinonGetPyRight());
// adjust Right
else Diamond_DisplayStart(0);
// Left
outp(PIC00,EOI); // 8259 IRQ
DONE
outp(LPTADDRESS + 2, 0x00); // fix PC
bug
outp(LPTADDRESS + 2, 0x10); // INT LPT
ON
} // iNovaIntChinon
//--------------------------------------------------------------------------
in short, no you cant with OpenGL if you require hardware support, as you have to request a context from the video drivers and they will keep things in video ram.
If you wanted to use a software driver like Mesa then you might be able to rig something up.
From my quick look over the code I guess what you are doing is sending one picture down the line, singling on the LPT port, then swapping to the next picture and singling again.
You might beable to attack this from another direction, render the image twice to two buffers (textures maybe), then draw one to the screen and swap the buffer and single and then draw the other and swap the buffer.
If you select a 120hz display mode in theory this should give you 60hz on each display).
I'd like to point out this is only guess work, but in theory the idea above should work.
If you wanted to use a software driver like Mesa then you might be able to rig something up.
From my quick look over the code I guess what you are doing is sending one picture down the line, singling on the LPT port, then swapping to the next picture and singling again.
You might beable to attack this from another direction, render the image twice to two buffers (textures maybe), then draw one to the screen and swap the buffer and single and then draw the other and swap the buffer.
If you select a 120hz display mode in theory this should give you 60hz on each display).
I'd like to point out this is only guess work, but in theory the idea above should work.
So basically you have two stereoscopic images, each representign what an eye sees.
I don't know how glasses work (you will need two screens for that, like you said), but in OpenGL you can displace the entire scene as much as you want (left or right) by slightly changing the camera position for every scene. In OpenGL you can also render the scene in a texture, so you can render it in two different textures (left and right views) then try to send each image to a different screen (I have no idea how to do that tho).
I don't know how glasses work (you will need two screens for that, like you said), but in OpenGL you can displace the entire scene as much as you want (left or right) by slightly changing the camera position for every scene. In OpenGL you can also render the scene in a texture, so you can render it in two different textures (left and right views) then try to send each image to a different screen (I have no idea how to do that tho).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement