Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: getting my stuff together

  1. #1

    getting my stuff together

    hey everyone

    I hope im posting in the right section since im asking general questions and i probably cant get more general than what im gonna ask

    Basically im an engineer student an i had my first fully procedural-only programming course this year with pascal and i loved it; Problem is i was taught mainly files and pointers-structure handling algorithms but for making games Im clueless of where to start.

    So I felt maybe you guys could point me towards the right direction, i mean, i didnt even know how to use something that wasnt the command line for making stuff AND I STILL sort of dont.

    Im leaning towards using OpenGL stuff like glut but then everyone playing in windows would have to install the glut32.dll right? and that sucks...

    Maybe i should just grab a game engine? im assuming then that a game engine is a simplified means for making games (maybe not?) and i was going the wrong way? i dont even know...

    any advise is greatly appreciated, thank yall

    TL;DR: im n00b, know basics, where start advise pl0x

  2. #2
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Depends on how much/what you have experience with. If you're starting from zero - I'd have no issues recommending SDL. Glut can be problematic as it is rather dated now, but since its' grub time - i'll fill you in on anything more specific if you need, once I get my share!
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  3. #3
    lol i just can use the language so thats my experience, im reading tuts on SDL thanks for that, i knew the graph unit wasnt gonna cut it for long

    this SDL thing is wonderful and easy to use, i just wish the compiler didnt complain so much now oh well, ill stop being retarded one of these days

  4. #4
    GLUT was created as a fast&dirty library to test OpenGL stuff. It's great for fast prototyping but not for final work.

    Currently I'm working in the wrapper to use the Allegro 5 library with Pascal (Allegro is a library similar than SDL but with different approach) and it's able to start an OpenGL context too. Windows works with issues (can't deal with pixel and text stuff yet) but OpenGL initialization, texture loading, user input, sound and time control seems to work. Linux works much better (as far as I can see, only prototype-drawing doesn't work correctly).

    I tell you just to show you an alternative to SDL.
    No signature provided yet.

  5. #5
    cool, that helped, for some reason i get an error with SDL from the compiler complaining about needing a unit and interface before "program" stuff and i dont even know what that is, guess its some of them fancy stuff from object oriented programming but OOP is out of my reach at least for this year

    so im actually downloading allegro.pas as i write to give it a try. sounds like one hell of a library and one hell of a project; id love to know what you mean by "there is pixel handling issues in windows", is it like it has problems working with single pixels or is it something with raster based stuff in general? id love to use allegro with my ubuntu installation but the free pascal compiler distributed in the software center is completely broken and i couldnt find a way to install it from rpm packages (yhea, im a n00b in linux too) so windows it is

  6. #6
    Quote Originally Posted by sacros View Post
    cool, that helped, for some reason i get an error with SDL from the compiler complaining about needing a unit and interface before "program" stuff and i dont even know what that is, guess its some of them fancy stuff from object oriented programming but OOP is out of my reach at least for this year
    Nope. It sounds like a basic level programming error, similar to this code would tell something crazy
    Code:
    then a=b if
    You'll always get help if you ask though, but then you need to refer the full error and part of the source code.

  7. #7
    thanks for the offer user137, i appreciate your help, i just wish you werent such an asshole with your " a=b " shit

    the problem is the compìler ask for "interface" or "unit" or "implementation" sections before the first line (?). note that i mimicked the code on the SDL tutorial on http://www.freepascal-meets-sdl.net/ (chapter 3) where it is assumed i dont need what im being asked plus it is supposed to work with the command line compiler IDE (which im using)

    since i only learned procedural pascal i dont know what an "interface" or "unit" or "implementation" is and as far as i know, the first line has always been "program program_name;"

    Code:
    program HelloSDL;    // the program intends to show a simple image on the screen
    USES SDL, CRT;     // as said, the problem is the compiler asks for an "interface" and "unit" section before this line
    
    VAR
    screen,picture:pSDL_SURFACE;
    source_rect,destination_rect:pSDL_RECT;
    
    BEGIN
    SDL_INIT(SDL_INIT_VIDEO);
    screen:=SDL_SETVIDEOMODE(423,400,32,SDL_SWSURFACE);
    IF screen=NIL THEN HALT;writeln('problem with the screen');
    
    picture:=SDL_LOADBMP('C:\Documents and Settings\briss\Escritorio\hello_image.bmp');
    IF picture=NIL THEN HALT;writeln('problem with the image');
    
    NEW(source_rect);
    source_rect^.x:=0;
    source_rect^.y:=0;
    source_rect^.w:=423;
    source_rect^.h:=400;
    NEW(destination_rect);
    destination_rect^.x:=0;
    destination_rect^.y:=0;
    destination_rect^.w:=423;
    destination_rect^.h:=400;
    
    REPEAT
      SDL_BLITSURFACE(picture,source_rect,screen,destination_rect);
      SDL_FLIP(screen);
    UNTIL keypressed;
    
    SDL_FREESURFACE(picture);
    SDL_FREESURFACE(screen);
    
    DISPOSE(source_rect);
    DISPOSE(destination_rect);
    
    SDL_QUIT;
    END.
    well, it would be great if you help me make it work, i was planning on checking out allegro pascal tonight anyways so no big deal if i dont get any solution

  8. #8
    Hmm, for console application that code looks valid. Normal pascal units have code structured like this:
    Code:
    unit MyUnit;
    interface
    uses ... 
    type
      ...
    implementation
    uses ...
    
    code...
    So for whatever reason, the compiler is treating your program as normal unit. Is it really the only file in the project, or how is it structured? What command did you use to compile it, or are you using Lazarus?

  9. #9
    For me the code compiles perfectly fine. As User137 already asked - are you using command line, or Lazarus? The other thing I'd suggest is taking a look whether the SDL .pas files are not bugged somehow, or if there aren't any additional files named HelloSDL laying around that the compiler might grab.

    And btw, an advice for the SDL code - it can be easier if you use TSDL_Rects, and use the @ operator to create a pointer for the BlitSurface routine.

  10. #10
    Quote Originally Posted by Super Vegeta View Post
    For me the code compiles perfectly fine. As User137 already asked - are you using command line, or Lazarus? The other thing I'd suggest is taking a look whether the SDL .pas files are not bugged somehow, or if there aren't any additional files named HelloSDL laying around that the compiler might grab.

    And btw, an advice for the SDL code - it can be easier if you use TSDL_Rects, and use the @ operator to create a pointer for the BlitSurface routine.
    whoa! you solved my problem, guess what the name of my file was: SDL.pas; I didnt even know stuff worked like that, i installed the library via an installation wizard - so the compiler was assuming i was talking about the library .pas. Ill also look into which kind of sorcery is that @ operator and TSDL_Rects

    now everything has turned color pink! not...new error, the code above now stops in the line:

    Code:
    screen:=SDL_SETVIDEOMODE(423,400,32,SDL_SWSURFACE);
    IF screen=NIL THEN HALT;writeln('problem with the screen');
    i also get the output "problem with the screen" so maybe there is a problem with the SDL_SETVIDEOMODE procedure? why nothing ever works at this rate im nevar gon build stuf

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •