Game Programming

Pages: 12
Suit yourself.
HTML5 -> JavaScript -> WebGL -> three.js
closed account (N36fSL3A)
Why would you use HTML5? You must be thinking of web games...
Same reason some use XML with their C++. You can make or use pre-existing HTML5 parser to make web pages and such for you game. EA's Sims series (at least in Sims 3) creates a folder after you make a character and start playing which ends up creating an XML/HTML files that end up having your character and other stats so you can view and share your information online if you like.

Have you never played with using C++ to output an HTML page, or XML, PHP?
how do you embed html xml or php into c++?
Well I'm sure you can embed them if you want to use them as a scripting language (though you would have to do a lot behind the scenes in order to make that work), but I was referring to parsing. I wrote a game several months back that created a php page with the high scores in a format so I could upload them to a website, but never bothered getting a web host and have long since deleted the game.

As I said, Sims 3 creates a xml and html page that shows your character and some other stats for the character.
Last edited on by closed account z6A9GNh0
You write a program in C++ that can generate HTML, XML or PHP.

Even something as simple as
1
2
3
4
5
6
7
#include <iostream>

int main()
{
        std::cout << "<?php echo \"<p>Hello, world!</p>\n\";?>";
        return 0;
}

qualifies.
Last edited on
oh ok so almost like an interpreter
@chrisname
No that will just output <php echo "<p>Hello, world!</p>\n"; ?> to the console. I was meaning:
1
2
3
4
5
6
7
8
#include <fstream>

int main()
{
	std::ofstream outfile("hello.html");
	outfile << "<h1>Hello, world!</h1>";
	return 0;
}


Wanted to do HTML as it can be tested on any computer while I don't know who has Apache/PHP set up on their computer.
Last edited on by closed account z6A9GNh0
Why would you use HTML5? You must be thinking of web games...


HTML5 can use a canvas on which you can render hardware accelerated 3D graphics if your browser supports it. WebGL is javascript API to openGL ES. It has to be written in javascript, because javascript is what can run client side (on your web browser), with access to your hardware. Three.js is a library which simplifies the use of WebGL.

http://mrdoob.github.com/three.js/

It's a wav of the future; pretty awesome. The best part is how accessible your programs can be.
Last edited on
Topic archived. No new replies allowed.
Pages: 12