David Olofson's smooth scroll example

Hello.

I took a look at David Olofson’s smooth scroll example and was amazed with
its high quality when using the OpenGL mode. In order to learn more about
the techniques (in particular, those related to OpenGL based tiling), I
downloaded the source code and tried to build it with the Borland’s Free C++
command line compiler. I was careful to include the -DWIN32 switch, since my
target is Windows, but am getting type declaration errors related to the use
of the ‘inline’ macro. There is one error message for each function
using it. Has anybody (David maybe) got any suggestions on what I should try
to do or look for?

Thank you,

Ney Andr? de Mello Zunino

P.S.: I apologize case this post is considered off-topic. The reason I
decided to send it here is that I thought other people, who are also trying
to learn from David’s neat examples, might also benefit from it.

IIRC the inline is a keyword specific to gcc.

You might have to remove them from the source, or
use

#define inline inline

instead> -----Original Message-----

From: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org]On
Behalf Of Ney
Andr? de Mello Zunino
Sent: sexta-feira, 5 de Julho de 2002 8:01
To: sdl at libsdl.org
Subject: [SDL] David Olofson’s smooth scroll example

Hello.

I took a look at David Olofson’s smooth scroll example and
was amazed with
its high quality when using the OpenGL mode. In order to
learn more about
the techniques (in particular, those related to OpenGL based
tiling), I
downloaded the source code and tried to build it with the
Borland’s Free C++
command line compiler. I was careful to include the -DWIN32
switch, since my
target is Windows, but am getting type declaration errors
related to the use
of the ‘inline’ macro. There is one error message for
each function
using it. Has anybody (David maybe) got any suggestions on
what I should try
to do or look for?

Thank you,

Ney Andr? de Mello Zunino

P.S.: I apologize case this post is considered off-topic. The reason I
decided to send it here is that I thought other people, who
are also trying
to learn from David’s neat examples, might also benefit from it.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi Ney,
I have just used CBuilder 6 to compile it and did not have any
problems compiling and running it as long as it can find begin_code.h
where it does the following…
#if defined(_MSC_VER)
#define inline __inline

begin_code.h should be in the SDL include directory. Also ensure that
you if compiling for Windows you need the following conditional defines…
NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL

Can anyone clarify what these would be in the case of Linux?

If you or David are interested, I can send you CBuilder6 projects as
well as a Borland Mak file along with the Borland compatible *.lib files
to ease the pain of future Borland developers.

Anyway, let me know.

L8R,

Dominique.

Ney Andr? de Mello Zunino wrote:> Hello.

I took a look at David Olofson’s smooth scroll example and was amazed with
its high quality when using the OpenGL mode. In order to learn more about
the techniques (in particular, those related to OpenGL based tiling), I
downloaded the source code and tried to build it with the Borland’s Free C++
command line compiler. I was careful to include the -DWIN32 switch, since my
target is Windows, but am getting type declaration errors related to the use
of the ‘inline’ macro. There is one error message for each function
using it. Has anybody (David maybe) got any suggestions on what I should try
to do or look for?

Thank you,

Ney Andr? de Mello Zunino

P.S.: I apologize case this post is considered off-topic. The reason I
decided to send it here is that I thought other people, who are also trying
to learn from David’s neat examples, might also benefit from it.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Well, you can just delete the inline directives.

Or you could try to figure out why SDL doesn’t #define inline
to something useful… (I normally use “inline”, and rely on
autoconf to make it work. This one relies on SDL.h, though.)

//David

.---------------------------------------
| David Olofson
| Programmer

david.olofson at reologica.se
Address:
REOLOGICA Instruments AB
Scheelev?gen 30
223 63 LUND
Sweden
---------------------------------------
Phone: 046-12 77 60
Fax: 046-12 50 57
Mobil:
E-mail: david.olofson at reologica.se
WWW: http://www.reologica.se

`-----> We Make Rheology RealOn Fri, 5/07/2002 16:00:33 , Ney Andr? de Mello Zunino wrote:

Hello.

I took a look at David Olofson’s smooth scroll example and was amazed with
its high quality when using the OpenGL mode. In order to learn more about
the techniques (in particular, those related to OpenGL based tiling), I
downloaded the source code and tried to build it with the Borland’s Free C++
command line compiler. I was careful to include the -DWIN32 switch, since my
target is Windows, but am getting type declaration errors related to the use
of the ‘inline’ macro. There is one error message for each function
using it. Has anybody (David maybe) got any suggestions on what I should try
to do or look for?

Hi Ney,
I have just used CBuilder 6 to compile it and did not have any
problems compiling and running it as long as it can find begin_code.h
where it does the following…
#if defined(_MSC_VER)
#define inline __inline

begin_code.h should be in the SDL include directory. Also ensure that
you if compiling for Windows you need the following conditional defines…
NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL

Can anyone clarify what these would be in the case of Linux?

IIRC, smoothscroll only cares about HAVE_OPENGL, which is normally
handled by autoconf.

The rest would be a pure SDL question, I think. :slight_smile:

If you or David are interested, I can send you CBuilder6 projects as
well as a Borland Mak file along with the Borland compatible *.lib files
to ease the pain of future Borland developers.

That would be great! (I only do automake/autoconf myself.)

//David

.---------------------------------------
| David Olofson
| Programmer

david.olofson at reologica.se
Address:
REOLOGICA Instruments AB
Scheelev?gen 30
223 63 LUND
Sweden
---------------------------------------
Phone: 046-12 77 60
Fax: 046-12 50 57
Mobil:
E-mail: david.olofson at reologica.se
WWW: http://www.reologica.se

`-----> We Make Rheology RealOn Fri, 05/07/2002 12:10:30 , Dominique Louis wrote:

Dominique Louis wrote:

If you or David are interested, I can send you CBuilder6 projects as
well as a Borland Mak file along with the Borland compatible *.lib
files to ease the pain of future Borland developers.

I would be glad if you could send me the make file. Since I only use the
command line compiler, I do not need the C++ Builder project file.

Thank you,–
Ney Andr? de Mello Zunino

Dominique Louis wrote:

#if defined(_MSC_VER)
#define inline __inline

begin_code.h should be in the SDL include directory. Also ensure that
you if compiling for Windows you need the following conditional defines…
NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL

I tried it defining all the symbols you mention, but it won’t work. The
only way I could get it to work was by commenting out the "inline"s
from the code. Since begin_code.h does #define it to “__inline” with the
condition you showed above, I concluded that the “_MSC_VER” symbol was
not being set. So, I tried adding it to the list of defined symbols
given to the compiler, but then I got errors in windows.h.

By the way, what does _MSC_VER stand for? Is it supposed to contain the
version of Microsoft Visual C(++)? In that case, I think it would be
better if I added a condition to begin_code.h to handle BCC’s case. Do
you know which is the symbol that identifies that compiler?

Thank you,–
Ney Andr? de Mello Zunino

Hi Ney,
I do not know what that might be at this stage. When I find out I
will let you know.

L8R,

Dominique.

Ney Andr? de Mello Zunino wrote:> Dominique Louis wrote:

#if defined(_MSC_VER)
#define inline __inline

begin_code.h should be in the SDL include directory. Also ensure that
you if compiling for Windows you need the following conditional
defines…
NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL

I tried it defining all the symbols you mention, but it won’t work. The
only way I could get it to work was by commenting out the "inline"s
from the code. Since begin_code.h does #define it to “__inline” with the
condition you showed above, I concluded that the “_MSC_VER” symbol was
not being set. So, I tried adding it to the list of defined symbols
given to the compiler, but then I got errors in windows.h.

By the way, what does _MSC_VER stand for? Is it supposed to contain the
version of Microsoft Visual C(++)? In that case, I think it would be
better if I added a condition to begin_code.h to handle BCC’s case. Do
you know which is the symbol that identifies that compiler?

Thank you,


http://www.DelphiGamer.com := for all your Object Pascal game
development needs;
http://www.delphi-jedi.org/Jedi:TEAM_SDL_HOME := Home of JEDI-SDL;
Cross-platform game development with Pascal, has never been easier.

Dominique Louis wrote:

I do not know what that might be at this stage. When I find out I
will let you know.

Nevermind, Dominique, I figured it out. There is a symbol BORLANDC
which does the trick. So, what I did was to add it to the condition in
begin_code.h:

#if defined(_MSC_VER) || defined(BORLANDC)
#define inline __inline

Regards,–
Ney Andr? de Mello Zunino

hi Ney,
Thanks for letting me know.

Dominique.

Ney Andr? de Mello Zunino wrote:> Dominique Louis wrote:

I do not know what that might be at this stage. When I find out I
will let you know.

Nevermind, Dominique, I figured it out. There is a symbol BORLANDC
which does the trick. So, what I did was to add it to the condition in
begin_code.h:

#if defined(_MSC_VER) || defined(BORLANDC)
#define inline __inline

Regards,

Dominique Louis wrote:

I do not know what that might be at this stage. When I find out I
will let you know.

Nevermind, Dominique, I figured it out. There is a symbol BORLANDC
which does the trick. So, what I did was to add it to the condition in
begin_code.h:

#if defined(_MSC_VER) || defined(BORLANDC)
#define inline __inline

Wierd, what version of SDL are you using? The latest code in CVS has
the following section:

/* Add any special compiler-specific cases here */
#if defined(_MSC_VER) || defined(BORLANDC) ||
defined(DMC) || defined(SC) ||
defined(WATCOMC) || defined(LCC)
#ifndef inline
#define inline __inline
#endif
#define SDL_INLINE_OKAY

-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sam Lantinga wrote:

#if defined(_MSC_VER) || defined(BORLANDC)
#define inline __inline

Wierd, what version of SDL are you using? The latest code in CVS has
the following section:

1.2.3 and its begin_code.h only had a test for _MSC_VER.

Anyway, I will get the latest one now! :slight_smile:

Regards,–
Ney Andr? de Mello Zunino