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

M

Michal M

Hi

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.
 
V

Victor Bazarov

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.[...]

Off-topic. Try 'comp.graphics.api.opengl'.

V
 
M

Michal M

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.[...]

Off-topic.  Try 'comp.graphics.api.opengl'.

V

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
chance.
 
V

Victor Bazarov

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.[...]

Off-topic. Try 'comp.graphics.api.opengl'.

V

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
chance.

This is then covered by FAQ 5.8.

V
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top