Search found 7 matches

by Void Mapper
Fri Feb 11, 2011 6:35 pm
Forum: Programming Discussion
Topic: how should a console be implemented
Replies: 11
Views: 1288

Re: how should a console be implemented

If you are ever doing enough console writing to demand use of multiple windows, then you should not be using default windows console as you have outgrown it. I will reccommend you write a simple class that creates a new window and another one that lets you write into it. Then you can create a singl...
by Void Mapper
Thu Feb 10, 2011 8:45 pm
Forum: Programming Discussion
Topic: how should a console be implemented
Replies: 11
Views: 1288

how should a console be implemented

I made a console using win32 controls but I'm not sure how to implement it. I had the idea of making a pure static class because I can't think of a situation where I would need multiple console windows. Does anyone have any better ideas?
by Void Mapper
Wed Jan 19, 2011 11:49 am
Forum: Programming Discussion
Topic: [solved] virtual functions or function pointers?
Replies: 20
Views: 2010

Re: which is faster, virtual functions or function pointers?

If either is actually faster, it's by a negligable amount. You have a game running on a CPU that's at least 1.5 GHz faster than your program needs, often even more, and you're concerned about function pointers vs virtual functions? You're way over-concerned with a very minor problem. Although, to a...
by Void Mapper
Wed Jan 19, 2011 12:34 am
Forum: Programming Discussion
Topic: [solved] virtual functions or function pointers?
Replies: 20
Views: 2010

[solved] virtual functions or function pointers?

In my game engine all the graphics related classes extend from a pure virtual base class that requires each of them to implement a draw function. I got the idea of using function pointers instead when I tried to recreate the engine in C. Would it be better to use function pointers or virtual functio...
by Void Mapper
Thu Jan 06, 2011 12:05 am
Forum: Programming Discussion
Topic: Advice on designing a generic event system
Replies: 5
Views: 606

Re: Advice on designing a generic event system

In order to really understand how SFML does it vs GLUT requires some more digging. I personally have gutted SFML's windowing code (for linux at least) in my pursuit to understand XLib. Basically what SFML has in the background is "handlers" that take system generated events, act upon them...
by Void Mapper
Wed Jan 05, 2011 10:07 pm
Forum: Programming Discussion
Topic: Advice on designing a generic event system
Replies: 5
Views: 606

Re: Advice on designing a generic event system

They really are the same thing, glut just wraps the loop in glutmainloop or whatever it is called, I would recommend not using glut or sfml, and just doing it in the os. the os will most likely have a loop where you process all the events. SFML creates it own separate queue for events, I doubt glut...
by Void Mapper
Wed Jan 05, 2011 9:05 pm
Forum: Programming Discussion
Topic: Advice on designing a generic event system
Replies: 5
Views: 606

Advice on designing a generic event system

I've been working on a simple 2D game library and I'm torn between the following two approaches for handling events. SFML style Event event; while(window.getEvents(&event) { switch(event.type) { } } GLUT style void mouseDown(Button); void keyDown(unsigned char); void windowClosed(void); window.m...