mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
sokol: type alias all sgl
structs, support sgl_context
(#13018)
This commit is contained in:
@ -26,7 +26,7 @@ const (
|
||||
struct App {
|
||||
mut:
|
||||
gg &gg.Context
|
||||
pip_3d C.sgl_pipeline
|
||||
pip_3d sgl.Pipeline
|
||||
texture gfx.Image
|
||||
init_flag bool
|
||||
frame_count int
|
||||
@ -315,7 +315,7 @@ fn my_init(mut app App) {
|
||||
// for a large number of the same type of object it is better use the instances!!
|
||||
desc := sapp.create_desc()
|
||||
gfx.setup(&desc)
|
||||
sgl_desc := C.sgl_desc_t{
|
||||
sgl_desc := sgl.Desc{
|
||||
max_vertices: 50 * 65536
|
||||
}
|
||||
sgl.setup(&sgl_desc)
|
||||
|
@ -37,7 +37,7 @@ const (
|
||||
struct App {
|
||||
mut:
|
||||
gg &gg.Context
|
||||
pip_3d C.sgl_pipeline
|
||||
pip_3d sgl.Pipeline
|
||||
texture gfx.Image
|
||||
init_flag bool
|
||||
frame_count int
|
||||
@ -486,7 +486,7 @@ fn my_init(mut app App) {
|
||||
// for a large number of the same type of object it is better use the instances!!
|
||||
desc := sapp.create_desc()
|
||||
gfx.setup(&desc)
|
||||
sgl_desc := C.sgl_desc_t{
|
||||
sgl_desc := sgl.Desc{
|
||||
max_vertices: 50 * 65536
|
||||
}
|
||||
sgl.setup(&sgl_desc)
|
||||
|
@ -325,7 +325,7 @@ fn my_init(mut app App) {
|
||||
// for a large number of the same type of object it is better use the instances!!
|
||||
desc := sapp.create_desc()
|
||||
gfx.setup(&desc)
|
||||
sgl_desc := C.sgl_desc_t{
|
||||
sgl_desc := sgl.Desc{
|
||||
max_vertices: 50 * 65536
|
||||
}
|
||||
sgl.setup(&sgl_desc)
|
||||
|
@ -513,7 +513,7 @@ fn my_init(mut app App) {
|
||||
// for a large number of the same type of object it is better use the instances!!
|
||||
desc := sapp.create_desc()
|
||||
gfx.setup(&desc)
|
||||
sgl_desc := C.sgl_desc_t{
|
||||
sgl_desc := sgl.Desc{
|
||||
max_vertices: 50 * 65536
|
||||
}
|
||||
sgl.setup(&sgl_desc)
|
||||
|
@ -212,7 +212,7 @@ fn my_init(mut app App) {
|
||||
// for a large number of the same type of object it is better use the instances!!
|
||||
desc := sapp.create_desc()
|
||||
gfx.setup(&desc)
|
||||
sgl_desc := C.sgl_desc_t{
|
||||
sgl_desc := sgl.Desc{
|
||||
max_vertices: 128 * 65536
|
||||
}
|
||||
sgl.setup(&sgl_desc)
|
||||
|
@ -29,7 +29,7 @@ fn main() {
|
||||
fn init(user_data voidptr) {
|
||||
desc := sapp.create_desc() // gfx.Desc{
|
||||
gfx.setup(&desc)
|
||||
sgl_desc := C.sgl_desc_t{}
|
||||
sgl_desc := sgl.Desc{}
|
||||
sgl.setup(&sgl_desc)
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ fn main() {
|
||||
fn init(mut state AppState) {
|
||||
desc := sapp.create_desc()
|
||||
gfx.setup(&desc)
|
||||
s := &C.sgl_desc_t{}
|
||||
s := &sgl.Desc{}
|
||||
C.sgl_setup(s)
|
||||
state.fons = sfons.create(512, 512, 1)
|
||||
// or use DroidSerif-Regular.ttf
|
||||
|
@ -96,7 +96,7 @@ fn init(user_data voidptr) {
|
||||
mut state := &AppState(user_data)
|
||||
desc := sapp.create_desc()
|
||||
gfx.setup(&desc)
|
||||
s := &C.sgl_desc_t{}
|
||||
s := &sgl.Desc{}
|
||||
C.sgl_setup(s)
|
||||
state.fons = sfons.create(512, 512, 1)
|
||||
// or use DroidSerif-Regular.ttf
|
||||
|
@ -31,7 +31,7 @@ mut:
|
||||
frame i64
|
||||
last i64
|
||||
ps particle.System
|
||||
alpha_pip C.sgl_pipeline
|
||||
alpha_pip sgl.Pipeline
|
||||
}
|
||||
|
||||
fn (mut a App) init() {
|
||||
@ -75,7 +75,7 @@ fn init(user_data voidptr) {
|
||||
mut app := &App(user_data)
|
||||
desc := sapp.create_desc()
|
||||
gfx.setup(&desc)
|
||||
sgl_desc := C.sgl_desc_t{
|
||||
sgl_desc := sgl.Desc{
|
||||
max_vertices: 50 * 65536
|
||||
}
|
||||
sgl.setup(&sgl_desc)
|
||||
|
Reference in New Issue
Block a user