Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!

We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Member Since 13 Feb 2013
Offline Last Active Oct 08 2014 07:01 PM

#5112775 Viability of Java For Video Games

Posted by samgj on 28 November 2013 - 09:39 AM

Java can be compiled to native machine code with GCJ, so then as long as you use the right libraries it would have the same performance as C++.

#5080946 Open a File as a String in Physics FS

Posted by samgj on 27 July 2013 - 08:15 AM


So you actually need something like:

Thanks, the with various versions of the function I tried when a script was runa script, I either got no output or, Python gave me an error like this:

  File "<string>", line 5
SyntaxError: invalid syntax

I now have this:

bool runscript(const char* pyname)
 //Loads and runs a specified script

 PHYSFS_File* pyfile = PHYSFS_openRead(pyname);

 if(pyfile != NULL)
  PHYSFS_sint64 filesize = PHYSFS_fileLength(pyfile);
  char* scriptbuffer = new char[ filesize ]; //Create the string the script will be stored in

  PHYSFS_read( pyfile, scriptbuffer, 1, filesize ); //opens the script

  PyRun_SimpleString( scriptbuffer ); //run the requested script. This is a temporary version, the final version will have low level embedding

  delete[] scriptbuffer;

  return true;

 else //if unable to open script
  return false;


This new version works. Promit, you had the last two arguments of PHYSFS_read() wrong. It should be size in bytes of each object then number of objects to read.

#5076156 Soviet Itellectual Property

Posted by samgj on 08 July 2013 - 10:28 AM

If something was created inside the Soviet Union, or another nation that no longer exists, is it still protected by copyrights or trademarks?