VOGONS


First post, by Glidos

User metadata
Rank l33t
Rank
l33t

Who is S.A. White? Why is he making changes to OpenGLide without having the courtesy to talk to me first? And who the fuck gave him access to the CVS repository?

Reply 4 of 16, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

I was able to compile Openglide in Windows with all the Linux modifications by adding this to GlOgl.h right before #include <windows.h>

#ifndef __WIN32__
# if defined ( _WIN32 ) || defined (WIN32) || defined(__NT__)
# define __WIN32__
# endif
#endif

so if linux support is desired it might be best to reapply the Linux modifications (not sure how it works there though).

Reply 5 of 16, by Glidos

User metadata
Rank l33t
Rank
l33t

I'd rather we didn't. I tagged the last Linux version in CVS, so anybody wanting to build it can check out that tagged version. I think we can get multiple platform independence more cleanly if we make a stronger separation between the platform independent and platform dependent parts, putting well defined interfaces between the two, so that we can have multiple implementations of the platform dependent parts, rather than piles of ifdefs.

When I looked more closely at what Simon had done, I found that 90% of it was lovely stuff on that path. I have already reapplied that.

Reply 6 of 16, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

Dunno, I find the modifications pretty harmless...like Intel and AT&T inline asm, replacing DWORDs with ints, including correct headers...and of course those few functions (like initialize and swapbuffers) that are completly different between the two platforms 😀

Reply 7 of 16, by Glidos

User metadata
Rank l33t
Rank
l33t

Most of which I've put back in, as I just said. But the asm can be done better by having just one version with a script to translate to the other, and the initalize swapbuffers stuff would be better in two seperate versions with a common interface. Its just an opertunity to do it really nicely, without introducing a load of ifdefs.

Admittedly I reverted the change originally partly because of being peeved at seeing a load of changes going through with no one consulting me after all the effort I've put into this, and also misjudging by how little it was broken. Come to it calmly again, I'd probably have left it in, and worked from there. But having now reverted it and taken the time to reapply the nicest bits, we may aswell stick with the current trunk, and work from there.

Reply 9 of 16, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

How about using SDL? Seems to work for dosbox...

Actually, I already wrote it (yeah, I have too much time despite having finals 😁). The patch consists of mostly removed code, 5(!) added SDL calls, 2 includes and 1 define 😀. I can post it if you're interested...

Reply 10 of 16, by Glidos

User metadata
Rank l33t
Rank
l33t

I wondered about SDL. Yeah, send me the patch,

One pain is that I've jsut done the separation of the platform specific code. Even committed some of it. But if SDL means much more will be platform independent then that's much better.

Reply 11 of 16, by Glidos

User metadata
Rank l33t
Rank
l33t

Hey, I can't build the linux version - neither the last version of Simon's or my current one. I get.

make  all-am
make[1]: Entering directory `/home/paul/OpenGlideL/openglide'
if /bin/sh ./libtool --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -D__unix__ -D__linux__ -MT FormatConversion.lo -MD -MP -MF ".deps/FormatConversion.Tpo" -c -o FormatConversion.lo FormatConversion.cpp; \
then mv -f ".deps/FormatConversion.Tpo" ".deps/FormatConversion.Plo"; else rm -f ".deps/FormatConversion.Tpo"; exit 1; fi
g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -D__unix__ -D__linux__ -MT FormatConversion.lo -MD -MP -MF .deps/FormatConversion.Tpo -c FormatConversion.cpp -fPIC -DPIC -o .libs/FormatConversion.o
/tmp/ccg7Ombz.s: Assembler messages:
/tmp/ccg7Ombz.s:425: Error: `(%rdi,%edx)' is not a valid base/index expression
/tmp/ccg7Ombz.s:425: Error: `(%rsi,%edx)' is not a valid base/index expression
/tmp/ccg7Ombz.s:443: Error: `(%rdi,%ecx)' is not a valid base/index expression
/tmp/ccg7Ombz.s:443: Error: `(%rdx,%ecx)' is not a valid base/index expression
/tmp/ccg7Ombz.s:461: Error: `(%rdi,%edx)' is not a valid base/index expression
/tmp/ccg7Ombz.s:461: Error: `(%rsi,%edx)' is not a valid base/index expression
/tmp/ccg7Ombz.s:479: Error: `(%rdi,%edx)' is not a valid base/index expression
/tmp/ccg7Ombz.s:479: Error: `(%rsi,%edx)' is not a valid base/index expression
/tmp/ccg7Ombz.s:497: Error: `(%rdi,%edx)' is not a valid base/index expression
/tmp/ccg7Ombz.s:497: Error: `(%rsi,%edx)' is not a valid base/index expression
/tmp/ccg7Ombz.s:515: Error: Incorrect register `%rdi' used with `l' suffix
/tmp/ccg7Ombz.s:515: Error: Incorrect register `%rsi' used with `l' suffix
/tmp/ccg7Ombz.s:515: Error: Incorrect register `%rdx' used with `l' suffix
make[1]: *** [FormatConversion.lo] Error 1
make[1]: Leaving directory `/home/paul/OpenGlideL/openglide'
make: *** [all] Error 2

I'm building on a AMD64 based system. Don't know if that has anything to do with it.

Reply 12 of 16, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

The Rxx registers suggest you're building a 64-bit version. Not sure how this affects the build though....

The following patch is against Simon's version, tested to compile & work under windows and linux. It clearly simplifies some things...It should work fine although I think restoring gamma does not work. I don't know why, it should 😀. Compilation obviously requires SDL headers and libs (and a runtime lib to work as well).

Attachments

  • Filename
    openglide-sdl.diff
    File size
    17.57 KiB
    Downloads
    1210 downloads
    File comment
    Patch for openglide to support opengl through sdl
    File license
    Fair use/fair dealing exception

Reply 13 of 16, by Glidos

User metadata
Rank l33t
Rank
l33t

That looks like it may well be the way to go.

Still want to finish off what I'm doing if I can though, even if I then just throw it away. Do you know how I can avoid generating a 64bit version? Maybe passing a flag to configure? I tried --host=i586-linux, but that didn't do it.

Reply 15 of 16, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

hmm...Set & GetGammaRamp work perfectly today (even in linux!) 🤣. I probably already had messed up values yesterday when I was testing it...

It's also interesting to note, that my sdl-patched version was failing glide test11 (lfb readback) with MesaGL, yet now when I switched to Ati accelerated libGL it's working fine as it is (I read the comment in GLutil.cpp about swapping buffers in X11). Maybe the drivers do proper doublebuffering...
The code separation might still be useful for the asm stuff (or maybe you could make sdl an option?). Also I think gcc RDTSC is broken...debug version didn't compile unless I commeted it out.

Reply 16 of 16, by Glidos

User metadata
Rank l33t
Rank
l33t

lfb readback has stopped working under Windows with the latest two versions of ATI's drivers. It looks as though reading directly in 565 format isn't supported although 32bit RGBA is ok. I'd love to know how to determine if 565 mode is supported.