Crazy idea: GML in C++!

Posted by Onyx on Sept. 2, 2006, 6:48 a.m.

I had a crazy idea last night: what if you could use GML statements in C++? Let me explain it better:

I figured that you could make a .cpp file that contains functions named same as statements in GML. Then you could simply include this file in the same manner you include your normal C++ libs. Offcourse, this is really simplyfied explanation.

So, when you write draw_text(0,0,"Hello World") it would acctualy call function that looks like this:

void draw_text(int x, int y, string text)
{
  cout << text
}

Here the x and y acctualy do nothing but you get the picture. So, programming in C++ would be like creating a "one script game" with all code written in room creation event. Just imagine it: simplicity of GML with power of C++!

I didn't say it will be easy. I didn't say I can do it right now, I'm starting college soon and I'll probably take C++ there. As I allready know a bit of C I belive I won't have much troubles learning it. And good ol' GM gave me idea of how OOP works. I plan to gain egnouh skill to make a pong game in C++ and then try to tackle this thing (probably adding egnouh functions so you can make a pong game).

So, do you think it's possible? Do you even think it would be usefull?

Comence commentig!

Comments

shadowstrike32 18 years, 2 months ago

Many people allready do that… except they actually do the intended functions and not their DOS-based shtuff.

melee-master 18 years, 2 months ago

Hehe. I thought about that ages ago. Too bad that draw_text doesn't actually write to a buffered screen.