Various patches for OpenGlide

Developer's Forum, for discussion of bugs, code, and other developmental aspects of OpenGLide.

Re: Various patches for OpenGlide

Postby Glidos » 2009-10-19 @ 11:34

gulikoza wrote:A few changes:

- fix a bug where lfb texture size is still assumed to be 1024 pixels (texture coordinates)
- use smallest possible lfb texture size *
- preserve window/fullscreen mode for SDL aplications (override config setting)

* hey wd, int_log2() incorrectly calculates size when the size is exactly pow 2. It will return 1024 when size is 512 for example :wink:


Ok, sorted. Sorry about the delay.
User avatar
Glidos
l33t
 
Posts: 3107
Joined: 2002-8-08 @ 02:55

Re: Various patches for OpenGlide

Postby gulikoza » 2009-10-19 @ 21:05

Dominus wrote:The next problem I ran into was that bootstrap complained about missing /platform/windows/makefile.in.


platform/windows/Makefile.am is missing from the cvs repository. It was in my patch but apparently it wasn't added. Paul? :happy:

Code: Select all
AUTOMAKE_OPTIONS = foreign

noinst_LTLIBRARIES = libwindows.la

libwindows_la_SOURCES = \
clock.cpp \
error.cpp \
openglext.cpp \
library.cpp \
window.cpp \
\
platform/clock.h \
platform/error.h \
platform/openglext.h \
platform/window.h \
platform/windows/platform.h
User avatar
gulikoza
Oldbie
 
Posts: 1618
Joined: 2004-6-25 @ 14:53

Re: Various patches for OpenGlide

Postby Dominus » 2009-10-19 @ 21:18

thanks, I get a bit further now and fail with
Code: Select all
Making all in sdl
/bin/sh ../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..   -I/opt/local/include -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/usr/include  -I/opt/local/include -mmmx -MT openglext.lo -MD -MP -MF .deps/openglext.Tpo -c -o openglext.lo openglext.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/usr/include -I/opt/local/include -mmmx -MT openglext.lo -MD -MP -MF .deps/openglext.Tpo -c openglext.cpp  -fno-common -DPIC -o .libs/openglext.o
In file included from openglext.cpp:20:
../../platform/openglext.h:16:22: error: platform.h: No such file or directory
In file included from openglext.cpp:20:
../../platform/openglext.h:18: error: ‘ExtFn’ does not name a type
openglext.cpp:22: error: ‘ExtFn’ does not name a type
make[3]: *** [openglext.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
User avatar
Dominus
DOSBox Moderator
 
Posts: 5645
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Various patches for OpenGlide

Postby gulikoza » 2009-10-19 @ 21:44

Quite expected, Openglide does not have any support for OS X :happyhappy:
Linux version might compile, but then again it most probably won't. For starters, you can create a new option in configure.ac:

*darwin*)

and duplicate the code from linux. Make sure SDL is detected and used as I guess it has more chances it will work (SDL should put all other OS X specific libs...), maybe add LIBS="$LIBS -framework OpenGL" that's what dosbox does :happyhappy:

If it works, post the patch, I'm sure Paul will be happy to apply it :happy:
User avatar
gulikoza
Oldbie
 
Posts: 1618
Joined: 2004-6-25 @ 14:53

Re: Various patches for OpenGlide

Postby Dominus » 2009-10-19 @ 21:48

he he, ok, I'll give it my best :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 5645
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Various patches for OpenGlide

Postby Dominus » 2009-10-19 @ 22:24

ok, some progress I guess...
I added to configure.ac:
Code: Select all
*darwin*)
   osflag="__linux__"
        CXXFLAGS="$CXXFLAGS -D__unix__ -D$osflag -I\$(top_srcdir)/platform/linux $X_CFLAGS"
        LIBS="$LIBS -lGL -lGLU"
        if test x$have_sdl_lib != xyes ; then
            X_EXTRA_LIBS="$X_EXTRA_LIBS -lXxf86vm"
        fi
   ;;


And with the exports I use for building Dosbox in 32bit (CFLAGS='-O2 -arch i386' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-O2 -arch i386' MACOSX_DEPLOYMENT_TARGET='10.6' CXX='/usr/bin/g++-4.2' F90FLAGS='-O2 -m32' LDFLAGS='-L/opt/local/lib -arch i386 -O2' OBJC='/usr/bin/gcc-4.2' FCFLAGS='-O2 -m32' INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2 -arch i386' FFLAGS='-O2 -m32' CC='/usr/bin/gcc-4.2')
I seem to have managed to build it.
I got
libglide2x.lai
libglide2x.la
libglide2x.a
libglide2x.dylib
libglide2x.0.dylib.dSYM.app
libglide2x.0.dylib

Now I only need to throw them where a patched dosbox will find them... :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 5645
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Various patches for OpenGlide

Postby Dominus » 2009-10-19 @ 22:53

A patched dosbox source fails in glide.cpp with
glide.cpp: In function ‘void process_msg(Bitu)’:
glide.cpp:476: error: ‘MAX_PATH’ was not declared in this scope
glide.cpp:774: error: ‘filename’ was not declared in this scope
make[4]: *** [glide.o] Error 1[/code]
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Not sure where I should continue with my error reporting now... in the dosbox glide patch thread or here... :)
Last edited by Dominus on 2009-10-19 @ 23:04, edited 1 time in total.
User avatar
Dominus
DOSBox Moderator
 
Posts: 5645
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Various patches for OpenGlide

Postby Glidos » 2009-10-19 @ 23:02

gulikoza wrote:platform/windows/Makefile.am is missing from the cvs repository. It was in my patch but apparently it wasn't added. Paul? :happy:

Oops! Sorted now.
User avatar
Glidos
l33t
 
Posts: 3107
Joined: 2002-8-08 @ 02:55

Re: Various patches for OpenGlide

Postby gulikoza » 2009-10-20 @ 06:55

Good news :). You can probably safely remove 'if test x$have_sdl_lib != xyes' and X_EXTRA_LIBS ... I doubt Xxf86vm exists anyway and that non SDL version will compile.

libglide2x.dylib is the dynamic library? Then you will have to add another line in glide.cpp, where it says load glide2x.dll (linux uses .so extension). The MAX_PATH seems a trivial issue, it is probably in some other include (dosbox uses it everywhere), perhaps you can just do #ifndef MAX_PATH #define MAX_PATH 4096 or something similar for now...
User avatar
gulikoza
Oldbie
 
Posts: 1618
Joined: 2004-6-25 @ 14:53

Re: Various patches for OpenGlide

Postby Dominus » 2009-10-20 @ 11:20

success!!! At least when I let the new compiled dosbox write a config it added the [glide] stuff to the config.
I added to glide.h
#ifndef MAX_PATH
#define MAX_PATH 4096
#endif

and changed the libglide.so to libglide.dylib in glide.cpp and it compiled. Could you add an if for darwin to use that on Mac?

@Glidos, could you add
Code: Select all
*darwin*)
       osflag="__linux__"
        CXXFLAGS="$CXXFLAGS -D__unix__ -D$osflag -I\$(top_srcdir)/platform/linux $X_CFLAGS"
        LIBS="$LIBS -lGL -lGLU"
      ;;

to configure.ac? Or do you need a patch (I'm not entirely sure how to do that) and if so, where do you need it, here or on the SF Openglide tracker?
User avatar
Dominus
DOSBox Moderator
 
Posts: 5645
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Various patches for OpenGlide

Postby wd » 2009-10-20 @ 12:28

The MAX_PATH seems a trivial issue, it is probably in some other include (dosbox uses it everywhere)

Erm 4x is not really everywhere, and all those cases are guarded by
WIN32 ifdef checks (as it's part of the dirent implementation for cross
platform file search operations).
But 4096 should be a rather safe limit for testing purposes, in dosbox it
is set to 512 or so.
wd
DOSBox Author
 
Posts: 10819
Joined: 2003-12-03 @ 21:23

Re: Various patches for OpenGlide

Postby Dominus » 2009-10-20 @ 12:40

something other, can one make Wine use openglide? I googled a bit and found no direct information, except that it is possible...
User avatar
Dominus
DOSBox Moderator
 
Posts: 5645
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Various patches for OpenGlide

Postby Sheriff Hobbes » 2014-6-05 @ 06:22

I'm not a programmer or anything. Can somebody please tell me how to apply these patches? Here's what I did:
- downloaded openglide from http://openglide.cvs.sourceforge.net
- put the patches in the extracted source folder
- tried to start patching by typing patch -p1 < openglide-ac.diff

This is what I got:

patching file GlOgl.h
Hunk #2 FAILED at 294.
1 out of 2 hunks FAILED -- saving rejects to file GlOgl.h.rej
patching file Glide.cpp
Hunk #1 FAILED at 48.
1 out of 1 hunk FAILED -- saving rejects to file Glide.cpp.rej
The next patch would create the file Glide2x.def,
which already exists! Assume -R? [n]


Thanks,
SH
Marriage is a three ring circus:
-engagement ring
-wedding ring
-suffering

H. L. Mencken
User avatar
Sheriff Hobbes
Newbie
 
Posts: 48
Joined: 2009-4-17 @ 06:58

Re: Various patches for OpenGlide

Postby Dominus » 2014-6-05 @ 06:41

I think the patches ate already merged to openglide
User avatar
Dominus
DOSBox Moderator
 
Posts: 5645
Joined: 2002-10-03 @ 09:54
Location: Vienna

Previous

Return to OpenGLide Development

Who is online

Users browsing this forum: No registered users and 0 guests