Page 1 of 1
OpenGL, I/O, and buttons
Posted: Tue Nov 23, 2010 1:36 am
by MadPumpkin
Does anyone know what probably the best I/O is to use with OpenGL that is NOT OS dependent? And also, what method do you all use for clickable buttons, I've been having problems making it simple.
Re: OpenGL, I/O, and buttons
Posted: Tue Nov 23, 2010 6:36 am
by Milch
I think SDL and SFML is what you're looking for, but unfortunately there is no "pure" I/O and window creating lib that I know of.
SDL/SFML have soo much unnecessary stuff in it that you simply don't use if you just want I/O and window creating.
Re: OpenGL, I/O, and buttons
Posted: Tue Nov 23, 2010 10:16 am
by Ginto8
SFML is very modular, so you can make it so that you only use windowing, and don't use (and therefore get the overhead from) the parts of the library you don't want to.
Re: OpenGL, I/O, and buttons
Posted: Tue Nov 23, 2010 12:05 pm
by Milch
Trust me, it is not as modular as it sounds at the first moment.
I've tried splitting it up into different DLLs and ended up having to link most of the stuff inside the main exe anyway.
Re: OpenGL, I/O, and buttons
Posted: Tue Nov 23, 2010 1:18 pm
by ismetteren
Milch wrote:I think SDL and SFML is what you're looking for, but unfortunately there is no "pure" I/O and window creating lib that I know of.
SDL/SFML have soo much unnecessary stuff in it that you simply don't use if you just want I/O and window creating.
http://en.wikipedia.org/wiki/Object_Ori ... put_System i think this is "pure" io. I have never used it directly, but it was a dependency for something i worked on. Maybe this is what you are looking for.
Edit:
More direct link:
http://sourceforge.net/projects/wgois/
Re: OpenGL, I/O, and buttons
Posted: Tue Nov 23, 2010 4:52 pm
by Falco Girgis
MadPumpkin wrote:Does anyone know what probably the best I/O is to use with OpenGL that is NOT OS dependent? And also, what method do you all use for clickable buttons, I've been having problems making it simple.
As long as whatever your targetted platform/architecture is has a proper implementation of the C and C++ standard libraries, both of those are "platform independent."
Use either the fscanf(), fprintf(), etc series with C or fstreams with C++.
Re: OpenGL, I/O, and buttons
Posted: Tue Nov 23, 2010 5:40 pm
by dandymcgee
GyroVorbis wrote:MadPumpkin wrote:Does anyone know what probably the best I/O is to use with OpenGL that is NOT OS dependent? And also, what method do you all use for clickable buttons, I've been having problems making it simple.
As long as whatever your targetted platform/architecture is has a proper implementation of the C and C++ standard libraries, both of those are "platform independent."
Use either the fscanf(), fprintf(), etc series with C or fstreams with C++.
I'm pretty sure he means user I/O, not file I/O.
Re: OpenGL, I/O, and buttons
Posted: Tue Nov 23, 2010 5:42 pm
by Falco Girgis
dandymcgee wrote:GyroVorbis wrote:MadPumpkin wrote:Does anyone know what probably the best I/O is to use with OpenGL that is NOT OS dependent? And also, what method do you all use for clickable buttons, I've been having problems making it simple.
As long as whatever your targetted platform/architecture is has a proper implementation of the C and C++ standard libraries, both of those are "platform independent."
Use either the fscanf(), fprintf(), etc series with C or fstreams with C++.
I'm pretty sure he means user I/O, not file I/O.
DOH!
Re: OpenGL, I/O, and buttons
Posted: Wed Nov 24, 2010 11:52 am
by N64vSNES
GyroVorbis wrote:dandymcgee wrote:GyroVorbis wrote:MadPumpkin wrote:Does anyone know what probably the best I/O is to use with OpenGL that is NOT OS dependent? And also, what method do you all use for clickable buttons, I've been having problems making it simple.
As long as whatever your targetted platform/architecture is has a proper implementation of the C and C++ standard libraries, both of those are "platform independent."
Use either the fscanf(), fprintf(), etc series with C or fstreams with C++.
I'm pretty sure he means user I/O, not file I/O.
DOH!
ROFL.
If you mean I/O as GUI then you would probably be best just writing a GUI system yourself
for example
Code: Select all
class Button {
public:
Button();
~Button();
bool IsMouseHover() {
if ( IsCollision(GetMouseRect(),Pos) ) {
return true;
}
return false;
}
bool IsClicked() {
if ( IsCollision(GetMouseRect(),Pos) ) {
if ( GetMouseState() == LEFT_CLICK ) {
return true;
}
}
return false;
}
void Render() {
// Draw your button here
}
private:
Rectangle Pos;
};
Re: OpenGL, I/O, and buttons
Posted: Thu Nov 25, 2010 7:25 pm
by MadPumpkin
Alright thanks everyone, and thank you N64vSNES for your way it's plenty simple haha.
Milch wrote:I think SDL and SFML is what you're looking for, but unfortunately there is no "pure" I/O and window creating lib that I know of.
SDL/SFML have soo much unnecessary stuff in it that you simply don't use if you just want I/O and window creating.
I'm quite familiar with SDL but not at all with SFML. I've heard lots of good things about SFML though. What are the differences between SFML and SDL?
Re: OpenGL, I/O, and buttons
Posted: Thu Nov 25, 2010 8:36 pm
by dandymcgee
MadPumpkin wrote:What are the differences between SFML and SDL?
To be honest, not many. I'd recommend SFML over SDL to a newbie, but if you're familiar with SDL already the benefits are minimal. SFML's 2D rendering capabilities are superior, and it has a few helper classes (ie. Sprite) similar to XNA.
Re: OpenGL, I/O, and buttons
Posted: Thu Nov 25, 2010 8:54 pm
by MadPumpkin
dandymcgee wrote:MadPumpkin wrote:What are the differences between SFML and SDL?
To be honest, not many. I'd recommend SFML over SDL to a newbie, but if you're familiar with SDL already the benefits are minimal. SFML's 2D rendering capabilities are superior, and it has a few helper classes (ie. Sprite) similar to XNA.
Oh alright, any rendering is pointless then actually xD I'm using OpenGL for rendering anyways.
Re: OpenGL, I/O, and buttons
Posted: Fri Nov 26, 2010 2:34 am
by Milch
Actually, SFML uses OpenGL to render stuff and SDL only uses software.
So thats a big difference!
Re: OpenGL, I/O, and buttons
Posted: Fri Nov 26, 2010 3:09 am
by dandymcgee
Milch wrote:Actually, SFML uses OpenGL to render stuff and SDL only uses software.
So thats a big difference!
No it's not because he's using OpenGL for rendering.