Search found 198 matches

by RandomDever
Mon Jun 18, 2012 3:22 am
Forum: Programming Discussion
Topic: OpenGL Fullscreen Crashing
Replies: 30
Views: 8747

Re: OpenGL Fullscreen Crashing

What is the most efficient way to deal with texture reloading? Usually you will want some form of central asset management. It can be something fancy, or it can be something really simple, like this: class TextureManager { public: static TextureManager& getInstance() { static TextureManager ins...
by RandomDever
Sun Jun 17, 2012 6:52 pm
Forum: Programming Discussion
Topic: OpenGL Fullscreen Crashing
Replies: 30
Views: 8747

Re: OpenGL Fullscreen Crashing

You need to define "crash." Are you getting an error message? Where does the problem crop up if you step through the code with a debugger? For starters you might want to try fixing your GL attributes. They must be set before SDL_SetVideoMode, as per SDL_GL_SetAttribute 's documentation. O...
by RandomDever
Sun Jun 17, 2012 5:55 pm
Forum: Programming Discussion
Topic: OpenGL Fullscreen Crashing
Replies: 30
Views: 8747

OpenGL Fullscreen Crashing

OpenGL seems to crash every time I toggle fullscreen. Is there some GL function I need to call before setting up the screen again? BTW here's my code: if( screen->flags & SDL_FULLSCREEN ) { Setup( screen->w, screen->h, screen->format->BitsPerPixel, screen->flags ^ SDL_FULLSCREEN ); } else { Setu...
by RandomDever
Sun Jun 17, 2012 1:11 am
Forum: Programming Discussion
Topic: Function Redefinition Errors
Replies: 10
Views: 2604

Re: Function Redefinition Errors

I don't think I will ever understand how c++ works.
It works now... I have no idea why. It just does.
Well thanks for trying anyways...
by RandomDever
Sun Jun 17, 2012 12:22 am
Forum: Programming Discussion
Topic: Function Redefinition Errors
Replies: 10
Views: 2604

Re: Function Redefinition Errors

Apparently, not. I tried it and I still got the linker errors. :(
by RandomDever
Sat Jun 16, 2012 9:09 pm
Forum: Programming Discussion
Topic: Function Redefinition Errors
Replies: 10
Views: 2604

Re: Function Redefinition Errors

If you mean the #ifndef guards then no I remembered those ( which only serves to confuse me more ). EDIT: If I knew how to make global variables that I can access from any file this problem could be resolved. Does anyone know how to do that? Because right now I'm just using namespaces, which apparen...
by RandomDever
Sat Jun 16, 2012 5:12 pm
Forum: Programming Discussion
Topic: Function Redefinition Errors
Replies: 10
Views: 2604

Function Redefinition Errors

So I'm building a new version of my engine from scratch for my next big project and I've been running into a problem lately. Example: 1>input.obj : error LNK2005: "bool Debug::debug" (?debug@Debug@@3_NA) already defined in program.obj 1>input.obj : error LNK2005: "class std::basic_ofs...
by RandomDever
Fri Apr 27, 2012 8:15 am
Forum: Game Development
Topic: Smooth Movement?
Replies: 25
Views: 8858

Re: Smooth Movement?

Indeed it did. Thank you.
BTW do you have any good articles on level design theory?

Edit: Specifically 2d platform level design theory.
by RandomDever
Thu Apr 26, 2012 9:04 am
Forum: Game Development
Topic: Smooth Movement?
Replies: 25
Views: 8858

Re: Smooth Movement?

Well that's a start but is there like an all-inclusive beginner's guide for people retooling from SDL to OpenGL because I have attempted this before and OpenGL does not like text rendering.
by RandomDever
Wed Apr 25, 2012 11:04 am
Forum: Game Development
Topic: Smooth Movement?
Replies: 25
Views: 8858

Re: Smooth Movement?

Well besides running my game at 100 fps, is there an easy way to implement OpenGL into my 'engine' so I don't have to do that for future projects?
by RandomDever
Thu Apr 19, 2012 8:13 pm
Forum: Game Development
Topic: Smooth Movement?
Replies: 25
Views: 8858

Re: Smooth Movement?

@lalacomun I would absolutely LOVE to be using OpenGL BUT I couldn't figure that out when I tried it before. And that was back when I had time to mess around with it. And by the way bumping up the frame rate help ALOT so thank you SO much. Now I can finally resume development. :mrgreen: Again thank ...
by RandomDever
Thu Apr 19, 2012 3:59 am
Forum: Game Development
Topic: Smooth Movement?
Replies: 25
Views: 8858

Re: Smooth Movement?

Let's say I have a square moving at a rate of 2 pixels per second.
It will move 2 pixels one frame and the next frame it will move like 4 pixels for no reason.
by RandomDever
Wed Apr 18, 2012 7:01 pm
Forum: Game Development
Topic: Smooth Movement?
Replies: 25
Views: 8858

Re: Smooth Movement?

Couldn't find any memory leaks, I don't have lighting or AI, and my FPS is capped at 60.
Any more suggestions?
by RandomDever
Wed Apr 18, 2012 5:23 am
Forum: Game Development
Topic: Smooth Movement?
Replies: 25
Views: 8858

Re: Smooth Movement?

There is no memory leak. Unless memory leak means something other than a constant increase in allocated memory. A memory leak is any memory which is allocated but not deallocated. This doesn't necessarily have to happen at any certain speed, as it depends where in your code the allocation is occurr...
by RandomDever
Tue Apr 17, 2012 10:16 pm
Forum: Game Development
Topic: Smooth Movement?
Replies: 25
Views: 8858

Re: Smooth Movement?

There is no memory leak. Unless memory leak means something other than a constant increase in allocated memory.
CPU usage stays around 10 and memory around 7,500k.
And I am using SDL for rendering because OpenGL is not supported by my engine. Yet.