OpenGL, I/O, and buttons

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

Post Reply
User avatar
MadPumpkin
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 484
Joined: Fri Feb 13, 2009 4:48 pm
Current Project: Octopia
Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
Programming Language of Choice: C/++,Java,Py,LUA,XML
Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk

OpenGL, I/O, and buttons

Post 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.
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock
Image
Image
Image
User avatar
Milch
Chaos Rift Junior
Chaos Rift Junior
Posts: 241
Joined: Sat Jul 11, 2009 5:55 am
Programming Language of Choice: C++
Location: Austria, Vienna

Re: OpenGL, I/O, and buttons

Post 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.
Follow me on twitter!
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: OpenGL, I/O, and buttons

Post 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.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
User avatar
Milch
Chaos Rift Junior
Chaos Rift Junior
Posts: 241
Joined: Sat Jul 11, 2009 5:55 am
Programming Language of Choice: C++
Location: Austria, Vienna

Re: OpenGL, I/O, and buttons

Post 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.
Follow me on twitter!
User avatar
ismetteren
Chaos Rift Junior
Chaos Rift Junior
Posts: 276
Joined: Mon Jul 21, 2008 4:13 pm

Re: OpenGL, I/O, and buttons

Post 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/
Image ImageImage Image
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: OpenGL, I/O, and buttons

Post 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++.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: OpenGL, I/O, and buttons

Post 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. ;)
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: OpenGL, I/O, and buttons

Post 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!
N64vSNES
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Thu Aug 12, 2010 11:25 am

Re: OpenGL, I/O, and buttons

Post 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;
};
User avatar
MadPumpkin
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 484
Joined: Fri Feb 13, 2009 4:48 pm
Current Project: Octopia
Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
Programming Language of Choice: C/++,Java,Py,LUA,XML
Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk

Re: OpenGL, I/O, and buttons

Post 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?
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock
Image
Image
Image
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: OpenGL, I/O, and buttons

Post 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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
MadPumpkin
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 484
Joined: Fri Feb 13, 2009 4:48 pm
Current Project: Octopia
Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
Programming Language of Choice: C/++,Java,Py,LUA,XML
Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk

Re: OpenGL, I/O, and buttons

Post 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.
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock
Image
Image
Image
User avatar
Milch
Chaos Rift Junior
Chaos Rift Junior
Posts: 241
Joined: Sat Jul 11, 2009 5:55 am
Programming Language of Choice: C++
Location: Austria, Vienna

Re: OpenGL, I/O, and buttons

Post by Milch »

Actually, SFML uses OpenGL to render stuff and SDL only uses software.
So thats a big difference!
Follow me on twitter!
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: OpenGL, I/O, and buttons

Post 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. ;)
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
Post Reply