1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

gg: fix android compilation for ~/.vmodules/ui/examples/rectangles.v

This commit is contained in:
Delyan Angelov 2022-07-06 16:02:50 +03:00
parent 82f7597a0c
commit f1a855e6d2
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -1,6 +1,5 @@
module gg module gg
import os
import sokol.sapp import sokol.sapp
#include <android/configuration.h> #include <android/configuration.h>
@ -13,7 +12,7 @@ fn C.AConfiguration_delete(voidptr)
// android_dpi_scale returns the scale factor of the device. // android_dpi_scale returns the scale factor of the device.
pub fn android_dpi_scale() f32 { pub fn android_dpi_scale() f32 {
config := C.AConfiguration_new() config := C.AConfiguration_new()
activity := &os.NativeActivity(sapp.android_get_native_activity()) activity := &C.ANativeActivity(sapp.android_get_native_activity())
C.AConfiguration_fromAssetManager(config, activity.assetManager) C.AConfiguration_fromAssetManager(config, activity.assetManager)
density := C.AConfiguration_getDensity(config) density := C.AConfiguration_getDensity(config)
C.AConfiguration_delete(config) C.AConfiguration_delete(config)