From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24485 invoked by alias); 19 Nov 2004 23:18:08 -0000 Mailing-List: contact xconq7-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: xconq7-owner@sources.redhat.com Received: (qmail 24150 invoked from network); 19 Nov 2004 23:18:00 -0000 Received: from unknown (HELO smtp801.mail.sc5.yahoo.com) (66.163.168.180) by sourceware.org with SMTP; 19 Nov 2004 23:18:00 -0000 Received: from unknown (HELO ?192.168.1.101?) (sampln@sbcglobal.net@67.123.175.195 with plain) by smtp801.mail.sc5.yahoo.com with SMTP; 19 Nov 2004 23:17:59 -0000 Subject: Re: SDL tutorials? From: Lincoln Peters To: Eric McDonald Cc: Xconq list In-Reply-To: <41996DAC.8070809@phy.cmich.edu> References: <1100567219.15874.9027.camel@localhost> <41996DAC.8070809@phy.cmich.edu> Content-Type: text/plain Message-Id: <1100906308.8386.18314.camel@localhost> Mime-Version: 1.0 Date: Fri, 19 Nov 2004 23:36:00 -0000 Content-Transfer-Encoding: 7bit X-SW-Source: 2004/txt/msg01420.txt.bz2 On Mon, 2004-11-15 at 19:02, Eric McDonald wrote: > Lincoln Peters wrote: > > I've been trying to learn SDL so that I can pitch in on the SDL > > interface, but every SDL tutorial I've found on the Internet fails to > > compile on my computer. And I'm fairly sure that the problem isn't my > > computer, because I have no difficulty compiling Xconq with the SDL > > interface, and I can't quite figure out why. > > > > Any recommended websites or other sources for learning SDL? > > The source code of various programs can be instructive. For example, if > you download the ParaGUI tarball, there are sources for the test > programs in the 'test' directory. Most of these are simple little apps, > but can give you a good feel for ParaGUI. I am sure that you can > probably find similar examples for pure SDL; I would try the sources of > some of the programs here: > http://www.libsdl.org/games.php I'll look at the 'test' directory and see if I can figure out how it works. > > Also, what sort of troubles are you having wrt compiling the tutorials? The code I've included below generates the following errors: main.o(.text+0x6d):/home/lincoln/test/main.cpp:44: undefined reference to `SDL_SetVideoMode' main.o(.text+0xa8):/home/lincoln/test/main.cpp:57: undefined reference to `SDL_Quit' collect2: ld returned 1 exit status The code itself is (in C++): #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include //using namespace std; //void DrawPixel(SDL_Surface *screen, int x, int y, // Uint8 R, Uint8 G, Uint8 B); //void Slock(SDL_Surface *screen); //void Sulock(SDL_Surface *screen); int main( /*int argc, char *argv[] */ ) { if ( SDL_Init( SDL_INIT_VIDEO ) != 0 ) { cout << "Unable to initialize video" << endl; return 1; } SDL_Surface *screen; screen = SDL_SetVideoMode( 640, 480, 32, SDL_HWSURFACE|SDL_DOUBLEBUF ); if ( screen == NULL ) { cout << "Unable to set up window" << endl; return 2; } // Slock( screen ); // Nothing to do, yet. // Sulock( screen ); SDL_Quit(); return EXIT_SUCCESS; } [End of code] --- Lincoln Peters Every program has (at least) two purposes: the one for which it was written and another for which it wasn't.