Geeks3D Forums

Geeks3D.com | GeeXLab | Softwares | Reviews | Downloads | Shader Lib 


News:GL-Z 0.4.0 cross-platform OpenGL and Vulkan utility

simple Lua framework over GeeXLab Lua API

(Read 5943 times)

0 Members and 1 Guest are viewing this topic.



Alex

  • Newbie
  • *
  • *
  • Posts: 26
Hi JeGX,

Can you share plans for high-level Lua framework over GeeXLab Lua API?

I am hoping to use new GeeXLab in similar way old GeeXLab was envisioned.

Kind regards,
Alex



JeGX

  • Global Moderator
  • Hero Member
  • *****
  • *
  • Posts: 1594
Yes I will try to code a skeleton of a high level framework as soon as possible....  :P   

Alex

  • Newbie
  • *
  • *
  • Posts: 26
Hi JeGX,

Any news about high level framework ?

Thanks,
Alex

JeGX

  • Global Moderator
  • Hero Member
  • *****
  • *
  • Posts: 1594
I started to code a tiny framework for Lua... I let you know asap  :P

Alex

  • Newbie
  • *
  • *
  • Posts: 26

Alex

  • Newbie
  • *
  • *
  • Posts: 26
Hi JeGX,

Happy new year !

Looking forward to upcoming Lua framework :)


JeGX

  • Global Moderator
  • Hero Member
  • *****
  • *
  • Posts: 1594
Sorry for the delay, I've worked on the new version of GeeXLab and as usual it took lot of time. I will add the small framework in the code sample...
And happy new year too!

Alex

  • Newbie
  • *
  • *
  • Posts: 26
Hey JeGX,

Any way to sponsor the effort of Lua framework and GeeXLab SDK ?

JeGX

  • Global Moderator
  • Hero Member
  • *****
  • *
  • Posts: 1594
I will upload asap the current version of the micro Lua framework on GeeXLab download page.

Alex

  • Newbie
  • *
  • *
  • Posts: 26

JeGX

  • Global Moderator
  • Hero Member
  • *****
  • *
  • Posts: 1594
Here is a first version of the simple Lua framework: Download

GeeXLab can be downloaded from this page

The simple Lua framework demo renders the following scene:



The framework is rather minimal and does only simple things. But it can be used as a base for a more advanced framework.

The principle of this framework is the following: you create objects in the INIT scripts and you render the scene in the FRAME script by calling hlf_render_frame(). It's a kind of retained mode. All 3d code (binding textures + gpu programs and objects rendering) is hidden in hlf_render_frame().


INIT script:
Code: [Select]
local demo_dir = gh_utils.get_demo_dir()
dofile(demo_dir .. "hlf.lua")


hlf_init()

local phong_prog = hlf_get_gpu_program_phong()
local phong_tex_prog = hlf_get_gpu_program_phong_texture()

torus = hlf_add_mesh_torus(10, 2, 20)
hlf_item_set_gpu_program(torus, phong_prog)
hlf_item_set_auto_spin(torus, 1, 11.0, 13.0, 17.0)


torus2 = hlf_add_mesh_torus(15, 2, 20)
hlf_item_set_gpu_program(torus2, phong_tex_prog)
hlf_item_set_auto_spin(torus2, 1, -11.0, -13.0, -17.0)


local t = hlf_load_texture(demo_dir .. "data/10857.jpg", "rgba_u8")
local texture_unit = hlf_item_add_texture(torus2, t)
hlf_item_set_uv_tiling(torus2, 8.0, 2.0, texture_unit)


hlf_stext_rgba(20, 20, 1.0, 1.0, 0.0, 1.0, "Simple Lua Framework")

frames = 0 -- frame counter



FRAME script:
Code: [Select]
hlf_set_background_color(0.2, 0.2, 0.2, 1.0)


hlf_dtext(20, 40, "- frames: " .. frames)
frames = frames + 1


hlf_render_frame()



SIZE script:
Code: [Select]
hlf_resize()


TERMINATE script:
Code: [Select]
hlf_terminate()


Alex

  • Newbie
  • *
  • *
  • Posts: 26
Hi JeGX,

Awesome news.

Thank you very much.