Can't get LWJGL to run using IDEA and SBT

前端 未结 2 527
南笙
南笙 2021-01-12 17:57

I\'ve been scratching myself in the head for a little over an hour with this, nothing on Google seems to be able to give me a decisive answer.

I\'m using Intel

2条回答
  •  無奈伤痛
    2021-01-12 18:28

    I know this is quite a bit old, but I thought this might help others who come across this problem. What I did myself was download the jar file from the site, extract the natives from the jar and add them to my resources directory. As for lwjgl I added it to my sbt project as you have. During runtime, I extracted the natives from the jar and loaded the native libraries using

    System.load("")
    

    then set the natives directory for lwjgl using

    System.setProperty("org.lwjgl.librarypath", )
    

    Also, as for extracting the natives from your jar file during runtime, you could do something like this

    val source = Channels.newChannel(
    NativesLoader.getClass.getClassLoader.getResourceAsStream(""))
    
    val fileOut = new File(, "")
    val dest = new FileOutputStream(fileOut)
    dest.getChannel.transferFrom(source, 0, Long.MaxValue)
    source.close()
    dest.close()
    

提交回复
热议问题