Info on OpenGL support
This commit is contained in:
57
zsnes/opengl.txt
Normal file
57
zsnes/opengl.txt
Normal file
@@ -0,0 +1,57 @@
|
||||
OpenGL is currently only avialable on Linux and via CVS. For the most
|
||||
part, it works and fairly stable. Please send all comments, suggestions,
|
||||
and bug fixes to hpsolo@my-deja.com. DO NOT EMAIL THE OTHER DEVELOPERS
|
||||
SINCE THEY ARE not INVOLVED WITH THIS CODE. And please make sure you've
|
||||
read through the list of known issues before sending your bug report.
|
||||
|
||||
|
||||
HOW OPENGL RENDERS THE SNES VIDEO BUFFER
|
||||
|
||||
The SNES video buffer has dimensions 288x224 (sometimes 288x239 for
|
||||
certain games; however I have not come across any). The first 16 and last
|
||||
16 column of pixels are not displayed (perhaps used as a scrolling
|
||||
buffer?), so the only important part of the video buffer is the middle
|
||||
256x224 pixels. The SNES video buffer pointer is vidbuffer. With OpenGL,
|
||||
only the visible 256x224 pixels are needed and they are cropped into
|
||||
glvidbuffer. glvidbuffer is then turned into a texture that gets bound to
|
||||
a QUAD whose size depends on whether ZSNES uses aspect ratio to display
|
||||
each frame.
|
||||
|
||||
|
||||
HI-RES FILTERS WITH OPENGL
|
||||
|
||||
The video mode selection is taken care of by SDL, including full
|
||||
screen mode. The current code does not allow for many hi-res filter
|
||||
options. While it is not difficult to implement the hi-res features using
|
||||
the current filtering code (in copyvwin.asm), it appears that the code for
|
||||
copy640x480x16bwin() causes memory corruption and sometimes segfaults when
|
||||
you exit ZSNES. For this reason, the filters have been left out. You can,
|
||||
however, add it in yourself by:
|
||||
|
||||
1. allocating enough memory space for glvidbuffer (use realloc)
|
||||
2. assign glvidbuffer to the destination pointer SurfBufD (instead of
|
||||
surface->pixels)
|
||||
3. setting Temp1 to surface->pitch, i.e. Temp1 = 2*SurfaceX
|
||||
4. calling copy640x480x16bwin()
|
||||
5. correctly binding the glvidbuffer as a texture to a QUAD
|
||||
|
||||
There is a old patch that enables these filters and it is located at:
|
||||
http://www.students.uiuc.edu/~handuong/opengl.patch2
|
||||
|
||||
|
||||
KNOWN ISSUES (AND SOME WORK-AROUNDS)
|
||||
|
||||
- after many video mode switches (all windowed), switching to full screen
|
||||
then back to window mode cases an SDL parachute exit; try not to use too
|
||||
many video mode changes, and restart ZSNES every once in a while if you
|
||||
are just testing out video modes
|
||||
|
||||
- segfault after having compiled the source -- this might be due to an old
|
||||
zguicfg.dat file; delete this and see if the problem gets fixed
|
||||
|
||||
|
||||
TODO
|
||||
|
||||
- use something like SDL_GL_UpdateRects with hi-res filters
|
||||
|
||||
-- hpsolo --
|
||||
Reference in New Issue
Block a user