Jump to content
  • Advertisement

Bahdom

Member
  • Content Count

    17
  • Joined

  • Last visited

Community Reputation

122 Neutral

About Bahdom

  • Rank
    Member
  1. I like both of them actually, and I'm under the impression that in both paths I'll eventually reach more of a management/lead position. The difference, at least from my point of view, is the moment of entry, and well, I'd have formal education in managing on one path and a more empirical approach from the other.
  2. Hi, I'll be earning my bachelors in Computer Science this year and have been considering getting a Masters Degree. At the moment, my two strongest options would be continuing in CompSci or switching to Project Management. As a side note, I would probably work and study so I would still be getting real world experience while getting my Masters. From an employer's point of view, would either one be more attractive than the other? I've been told taking Project Management helps reduce the time spent as a "code monkey" but I'm curious if the CompSci degree might make me more appealing hire. On the other hand, I think since I would already have a degree in CompSci, diversifying might make me stand out. Basically I was wondering what you thought about either degree. Thanks
  3. Bahdom

    Starting 2D Game Programming

    http://lazyfoo.net/SDL_tutorials/index.php you should probably learn a programming language first though [if you use my link then learn C/C++]
  4. It seems like you blitted the text to the background but didnt blit the background to the screen. If you update a surface you have to re-blit it on screen for the change to be visible; previously blitted surfaces are not 'bound' to the screen.
  5. I made a testScreenSettings method to verify the validity of w/h/bpp/etc to test the settings before applying them and now everything seems to work fine (even the random height issues). Thanks alot =]
  6. Hi, I am trying to make an SDL window resizable, however, whenever I stretch the width, the height seems to randomly increase on its own. If I verify the resulting height value in resizeWindow its usually a number with more than 6 digits. Even if I "diagonally stretch" the window the result is the same. This does not happen if I only stretch the height. The event code: case SDL_VIDEORESIZE: engine.graphics->resizeWindow(event.resize.w, event.resize.h); engine.screenW = engine.graphics->getScreenW(); engine.screenH = engine.graphics->getScreenH(); resetWindowDependantValues(); break; As a side question: is it better to let the user drag&drop to a desired size and use that resolution when he goes fullscreen or limit the fullscreen resolutions to a set list (800x600, 1024x768, etc)? Also, I had a question about the resizing of the window itself. Is it possible to *test* the selected window settings? For example: SDL_Surface* tempScreen; tempScreen = SDL_SetVideoMode(screenW, screenH, screenBPP, SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_RESIZABLE|SDL_FULLSCREEN); if(tempScreen) screen = tempScreen; That won't work since doing SetVideoMode would release the old screen value possibly leaving the application without a valid screen. Is the only way to do this storing the working settings and reinitializing in case the new settings don't work? [Edited by - Bahdom on January 26, 2009 1:12:07 PM]
  7. Quote:Original post by Essel Well I had a background image that needed to be the exact size of the screen, but when I reference the h and w ints in the SDL_Surface class, it crashes the game. Have you checked if you're actually pointing at a surface? (assuming its a pointer). If you try to get the w/h from a surface thats not there you'll get a segmentation fault and your program will crash.
  8. Bahdom

    SDL_BlitSurface alternative?

    BBCode: [ code] Quote:Original post by fmwyso GLuint Surface2Texture() { SDL_Surface *surface = IMG_Load("cursor.png"); GLuint texture; GLenum texture_format; GLint nOfColors; if(surface->format->BitsPerPixel = 4){ } // get the number of channels in the SDL surface nOfColors = surface->format->BytesPerPixel; if (nOfColors == 4) // contains an alpha channel { if (surface->format->Rmask == 0x000000ff) texture_format = GL_RGBA; else texture_format = GL_BGRA; } else if (nOfColors == 3) // no alpha channel { if (surface->format->Rmask == 0x000000ff) texture_format = GL_RGB; else texture_format = GL_BGR; } // Have OpenGL generate a texture object handle for us glGenTextures( 1, &texture ); // Bind the texture object glBindTexture( GL_TEXTURE_2D, texture ); // Set the texture's stretching properties glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); // Edit the texture object's image data using the information SDL_Surface gives us glTexImage2D( GL_TEXTURE_2D, 0, nOfColors, surface->w, surface->h, 0, texture_format, GL_UNSIGNED_BYTE, surface->pixels ); return texture; }
  9. Bahdom

    SDL_BlitSurface alternative?

    Quote:Original post by fmwyso Most importantly, why it needs to have the screen and why it needs two SDL_Rects SDL_BlitSurface works by taking a source surface, a rectangle that marks which area we want to blit, the destination surface, and the rectangle that marks where we want to blit the source surface. So for example, lets say I have an 8x8 surface but I only want to use the top left 2x2 portion of it (like if it were a sprite sheet). Thats where the first rectangle comes in, when you set its w&h to 2 and its x&y to 0, you'd be effectively selecting the 2x2 portion you wanted. Same for the other surface and rectangle, if i want to place it in the middle of the second surface I'd make a the second rectangle w&h = 2 and x = w/2 and y = h/2 (this will be offset a little since im not taking into account the w&h of the image we're blitting). That way, you are selecting the exact part of the original surface you want and placing it in the exact part of the destination surface you want. If you send 0 for either surface then you're selecting the whole surface: SDL_BlitSurface( pRect1, 0, pRect2, 0); blits all the first surface on to all the second surface You need the screen because thats the surface you want to blit to. Hope this helps =]
  10. Although circular dependancies are "doable" they are usually the result of bad design (at least in my experience). Try to find some other way to implement this.
  11. Bahdom

    OOP design with 2D game

    getTile() ?
  12. Bahdom

    OOP design with 2D game

    Should collisions be handled by the player object at all? I always figured it was something to be left to a physics section.
  13. Bahdom

    Assassin's Creed

    less repetitive would've been nice
  14. Bahdom

    funny (but useful) code

    #define ever ;; for(ever){} [works in c++ =p ]
  15. Did you include the std library? It doesn't show up on your .h
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!