Rapti
Rapti

Reputation: 2672

Using a C++ API in Java

I'm, currently developing a game in Java and want to publish it on Steam when it's finished. Their website says the Steam API was written in C++, and when I e-mailed them to ask whether there is a way to use the API in Java, they told me I had to write a wrapper for this

My question is: How do I write such a wrapper, or did someone else write this previously and made it available for downloading?

Upvotes: 3

Views: 2861

Answers (2)

G. Martinek
G. Martinek

Reputation: 276

You can use SWIG to automatically generate the glue code (JNI).

You need the C++ header files and can create java packages and classes
which you can use in you project.
See Swig and Java for details.

Upvotes: 3

Alnitak
Alnitak

Reputation: 339975

The key technology you're looking for is the Java Native Interface

Upvotes: 3

Related Questions