-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support LumePad 2 3D (WIP, breaks other devices)
- Loading branch information
1 parent
09c9435
commit c51cfe5
Showing
14 changed files
with
288 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
app/src/main/java/com/simongellis/vvb/emulator/CNSDKRenderer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.simongellis.vvb.emulator | ||
|
||
import androidx.annotation.ColorInt | ||
|
||
class CNSDKRenderer(emulator: Emulator, settings: Settings): Renderer { | ||
private var _pointer = 0L | ||
|
||
init { | ||
nativeConstructor(emulator, settings) | ||
} | ||
|
||
fun finalize() { | ||
destroy() | ||
} | ||
|
||
override fun destroy() { | ||
if (_pointer != 0L) { | ||
nativeDestructor() | ||
} | ||
} | ||
|
||
override fun onSurfaceCreated() { | ||
nativeOnSurfaceCreated() | ||
} | ||
|
||
override fun onSurfaceChanged(width: Int, height: Int) { | ||
nativeOnSurfaceChanged(width, height) | ||
} | ||
|
||
override fun onDrawFrame() { | ||
nativeOnDrawFrame() | ||
} | ||
|
||
class Settings( | ||
val screenZoom: Float, | ||
val aspectRatio: Int, | ||
val verticalOffset: Float, | ||
@ColorInt val color: Int) | ||
|
||
private external fun nativeConstructor(emulator: Emulator, settings: Settings) | ||
private external fun nativeDestructor() | ||
private external fun nativeOnSurfaceCreated() | ||
private external fun nativeOnSurfaceChanged(width: Int, height: Int) | ||
private external fun nativeOnDrawFrame() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
configurations.maybeCreate("default") | ||
artifacts.add("default", file('cnsdk.aar')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
include ':cardboard-sdk' | ||
include ':leia-cnsdk' | ||
include ':app' | ||
rootProject.name = "Virtual Virtual Boy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.