com.codedisaster.steamworks.SteamInterface Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of steamworks4j Show documentation
Show all versions of steamworks4j Show documentation
Java wrapper to access the Steamworks API.
package com.codedisaster.steamworks;
abstract class SteamInterface {
protected final long pointer;
protected long callback;
SteamInterface(long pointer) {
this(pointer, 0L);
}
SteamInterface(long pointer, long callback) {
if (pointer == 0L) {
throw new RuntimeException("Steam interface created with null pointer." +
" Always check result of SteamAPI.init(), or with SteamAPI.isSteamRunning()!");
}
this.pointer = pointer;
this.callback = callback;
}
void setCallback(long callback) {
this.callback = callback;
}
public void dispose() {
deleteCallback(callback);
}
/*JNI
#include "SteamCallbackAdapter.h"
*/
static protected native void deleteCallback(long callback); /*
delete (SteamCallbackAdapter*) callback;
*/
}