PDA

View Full Version : [OpenGL] - How do I change resolution?



I_am_root
30-07-2006, 03:26 PM
I am making a 3d game and I want to change screen resolution to 640x480x32 when the game starts. How can I do that in a multiplatform way in FreePASCAL? Thanks in advance.




____________________
Regards,
Eduard

marmin
30-07-2006, 07:17 PM
What lib are you using ? SDL, Glut? Which system? Linux, Win32?
I advise to use a GUI like Lazarus or Delphi for 3D development. It's easier.

I_am_root
31-07-2006, 01:21 AM
1. I use both Windows & Linux.

2. I don't use Lazarus because :
2.1 It's slow
2.2 I don't need it for game developement

3. I don't use Delphi because :
3.1 It's only under Micro$oft.


So I want a non-GLUT, simple, multiplatform solution to this small problem( fullscreen initialization in OpenGL). Thanks in advance for your presise & clear answers.

alexione
31-07-2006, 02:12 AM
Lazarus is slow?? Which versio do you use?

cragwolf
31-07-2006, 02:22 AM
Then use JEDI-SDL. Here is wiki on the subject:

http://www.freepascal.org/wiki/index.php/FPC_and_SDL

Here is link to latest JEDI-SDL:

http://sourceforge.net/projects/jedi-sdl

Here is SDL docs:

http://www.libsdl.org/cgi/docwiki.cgi/SDL_20API

You will want to use the SDL_SetVideoMode function with the SDL_OPENGL flag, with the appropriate width and height parameters, and if you want full screen you will pass the SDL_FULLSCREEN flag.

GLUT is simpler to use, but does not have as many features.

I_am_root
31-07-2006, 03:32 AM
@alexione : it's because of my Pentium II...


@cragwolf : I went on the pages, installed SDL on my system, but the thing about the SDL headers - I do not understand :shock:...I am quite new to FreePASCAL :oops: ... Please explain clearly : do I have to write the options on the command-line each time I have to compile a OpenGL-SDL program? Thanks!




_______________
Best Regards,
Eduard

marmin
31-07-2006, 05:05 PM
Take a look at the SDL documentation. See the SDL site..

cragwolf
31-07-2006, 10:45 PM
You don't need any command-line options, as long as you configure your fpc.cfg file properly, as shown on the FPC_and_SDL wiki. Read the documentation that comes with JEDI-SDL.

I_am_root
01-08-2006, 12:03 AM
Sorry for not telling you this *before* - my internet provider is stupid; I can't download anything from the site sourceforge(THE HOME OF OPEN SOURCE!!!). It just shows me the menu, (no banner) and the dark-red background - doesn't load anything else. Can somebody upload http://prdownloads.sourceforge.net/jedi-sdl/JEDI-SDLv0.5.zip?download on his/her FTP or send it by e-mail (sliced in 9.9MB slices, of course)... Thank you very much and really sorry for being a real pain in the... you know :) .


My e-mail is : 1nv3ntatoru (at) yahoo (dot) ca
(The "1" stands for "i" and the "3" stands for "e")


__________________
Many regards,
Eduard