Я пытаюсь порта Котлин в openvr bindingКак перевести Java ЮНА интерфейс Котлин
У меня есть следующие в Java:
public class IVRSystem extends Structure {
/**
* C type : GetRecommendedRenderTargetSize_callback*
*/
public IVRSystem.GetRecommendedRenderTargetSize_callback GetRecommendedRenderTargetSize;
public interface GetRecommendedRenderTargetSize_callback extends Callback {
void apply(IntBuffer pnWidth, IntBuffer pnHeight);
};
}
Intellij переводит его автоматически
var GetRecommendedRenderTargetSize: IVRSystem.GetRecommendedRenderTargetSize_callback? = null
interface GetRecommendedRenderTargetSize_callback : Callback {
fun apply(pnWidth: IntBuffer, pnHeight: IntBuffer)
}
Я изменил его затем на:
fun getRecommendedRenderTargetSize(pnWidth: IntBuffer, pnHeight: IntBuffer) = GetRecommendedRenderTargetSize_callback.apply(pnWidth, pnHeight)
interface GetRecommendedRenderTargetSize_callback : Callback {
fun apply(pnWidth: IntBuffer, pnHeight: IntBuffer)
}
, но он жалуется
неразрешенных ссылок: применять
Почему? Как я могу это исправить?
Для справки кода C++
class IVRSystem
{
public:
virtual void GetRecommendedRenderTargetSize(uint32_t *pnWidth, uint32_t *pnHeight) = 0;
}
Вы имеете в виду 'ivrSystem.GetRecommendedRenderTargetSize.apply (...)'? Потому что это должно быть так – elect