Sign in to follow this  
TruckMack33

Client Based Game

Recommended Posts

Okay, I want to try to make a web based program. I'm currently using openGL and C++. I'm using Visual Studio Express. I figure that I can't directly connect to the mySQL database because of possible security problems. Do I need to set up a client and server. Where the server connects to the mySQL database. Can anyone point me in a direction? I can't find anything other then php examples for mySQL. [Edited by - TruckMack33 on September 16, 2008 11:39:54 PM]

Share this post


Link to post
Share on other sites
A web-based program using OpenGL? I'm confused...

Get a clear idea of what the architecture of your project is going to be like before you start programming. Will you serve static HTML pages, or will you use javascript? Are you going to be running Apache? Can you get away with using CGI for the server-side program or do you need to write an Apache module? What machines are you going to use to run what?

If you are very new to web programming, I would recommend you learn how CGI works. Perhaps you should start here . These days you should also learn something about AJAX (a.k.a. "javascript now works").

If you are having trouble having your server-side program connect to a mySQL database, please post a more specific question.

Share this post


Link to post
Share on other sites
Okay, maybe web based isn't the most accurate term to use.
It's web based since technically it will have to use the internet(web).
I'm trying to make a client, that uses window forms.
I have been using GLUT and OpenGL to create window forms.
This has nothing to do with html or web-pages.

Share this post


Link to post
Share on other sites
Quote:
Original post by TruckMack33
Okay, maybe web based isn't the most accurate term to use.
It's web based since technically it will have to use the internet(web).
I'm trying to make a client, that uses window forms.
I have been using GLUT and OpenGL to create window forms.
This has nothing to do with html or web-pages.

The Internet and the web are different things. The web involves html, web pages, web browsers and all that jazz.

You still have to think up the architecture of the whole system. What programs will be running on what machines? What do they have to do? The list of things they will have to do includes accessing a mySQL database, serving TCP sockets, bringing up windows, reacting to keyboard and mouse events... You should learn how to do all those things, one at a time.

If you have trouble with any of them, post a more specific question.

Share this post


Link to post
Share on other sites
I know the basic structure. Since both GLUT and OpenGL are cross platform, it would be possible to make it run on both windows and Linux. All my question is, how do I retrieve information from the MySQL database without directly connecting to the database? Do I have to effectively create a whole server using sockets and it's protocols?

Share this post


Link to post
Share on other sites
Quote:
Do I have to effectively create a whole server using sockets and it's protocols?
If this is an internet program, you'd need sockets anyway. Once you leave your computer, you need sockets. I think the most secure way is to have one computer to communicate, and another to host the database, but that is terribly slow for anything real time. A server running both the database and the communications protocol is in order, unless it's peer to peer, in which case everyone has their own database and hacking is not much of an issue. The only problem there is finding a way to get people connected without a central location.

I am a huge proponent of SDL (even though I was a little shaky when I first picked it up), and one of the extensions to SDL is SDL_Net. Not the most beautiful of all platform independent network API's, but it works and is readily understood. This would get you on the right track for your sockets. I'd ditch GLUT entirely.

Share this post


Link to post
Share on other sites
Quote:
Original post by TruckMack33
I know the basic structure. Since both GLUT and OpenGL are cross platform, it would be possible to make it run on both windows and Linux. All my question is, how do I retrieve information from the MySQL database without directly connecting to the database? Do I have to effectively create a whole server using sockets and it's protocols?

No, because if it's truly -web- based, you can use an off-the-shelf web server that handles that for you. This will involve writing software for the server, but not the low level networking such as socket handling.

If it's not truly web based, and is just internet based, then yes, you will be writing yourself a server to do this.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this