SDL + OpenGL problem with textures in simple Asteroids-like game

Discussion in 'C++' started by Michal M, May 27, 2011.

  1. Michal M

    Michal M Guest


    I have to write a simple game to school. It is first thing I am
    writing using c++ and first time I am using SDL and OpenGL. I run into
    a problem which I cannot solve or diagnose by myself.
    I have noticed that if I load more textures they start to behave
    strangely. Let me to explain it on example.
    It is simple 2d game. I have ship controlled by player, asteroids and
    background. Each have its own textures. All asteroids have the same
    set of textures which I change so it looks like it is animated.
    Let's say I put 30 such objects into a scene. Then I notice that few
    of them is invisible. They do not have texture applied. The problem
    become worse with the number of loaded textures but not with their
    size. I have background composed of few textures 1024x1024 and if I
    switch it off it does not make any difference.
    What is most weird if I run program under Eclipse in debug mode then
    everything looks ok. If I run the same .exe from Windows it is broken.

    I have been checking my code for 3 days and I stuck. There is nothing
    more I am able to do.
    I would appreciate any help.
    I can share my code but I cannot extract small part from it, which
    could show a problem.

    Best regards
    Michal M.
    Michal M, May 27, 2011
    1. Advertisements

  2. Off-topic. Try ''.

    Victor Bazarov, May 27, 2011
    1. Advertisements

  3. Michal M

    Michal M Guest

    Thanks for an answer. I decided to put it here because I think it must
    be my mistake in pure c++ and not opengl problem as I read that opengl
    can handle textures itself. And yes I am aware that from I have
    written it is hard to help but I am in despair and try to take every
    Michal M, May 27, 2011
  4. This is then covered by FAQ 5.8.

    Victor Bazarov, May 27, 2011
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.