Neko; Making it possible to build low level lime neko builds, but there is some weirdities still.
This commit is contained in:
@@ -53,18 +53,18 @@ class Main {
|
||||
|
||||
//Create a set of vertices
|
||||
var vertices : Float32Array = new Float32Array([
|
||||
100, 100, 0,
|
||||
-100, 100, 0,
|
||||
100, -100, 0,
|
||||
-100, -100, 0
|
||||
100.0, 100.0, 0.0,
|
||||
-100.0, 100.0, 0.0,
|
||||
100.0, -100.0, 0.0,
|
||||
-100.0, -100.0, 0.0
|
||||
]);
|
||||
|
||||
//Create a buffer from OpenGL
|
||||
vertexBuffer = GL.createBuffer ();
|
||||
vertexBuffer = GL.createBuffer();
|
||||
//Bind it
|
||||
GL.bindBuffer (GL.ARRAY_BUFFER, vertexBuffer);
|
||||
GL.bindBuffer( GL.ARRAY_BUFFER, vertexBuffer );
|
||||
//Point it to the vertex array!
|
||||
GL.bufferData (GL.ARRAY_BUFFER, vertices, GL.STATIC_DRAW);
|
||||
GL.bufferData( GL.ARRAY_BUFFER, vertices, GL.STATIC_DRAW );
|
||||
|
||||
} //init
|
||||
|
||||
|
||||
@@ -154,7 +154,6 @@ class InputHandler {
|
||||
last_mouse_x = _event.x;
|
||||
last_mouse_y = _event.y;
|
||||
|
||||
// trace("mouse moved, new : " + _event.x + ' ' + _event.y);
|
||||
// trace("mouse moved, delta : " + deltaX + ' ' + deltaY);
|
||||
|
||||
if(lib.host.onmousemove != null) {
|
||||
|
||||
@@ -69,7 +69,11 @@ class LiME {
|
||||
|
||||
//default to 60 fps
|
||||
if( config.fps != null ) {
|
||||
if(Std.is(config.fps, String)) {
|
||||
frame_rate = Std.parseFloat( config.fps );
|
||||
} else {
|
||||
frame_rate = config.fps;
|
||||
}
|
||||
} else { //config.fps
|
||||
frame_rate = 60;
|
||||
}
|
||||
@@ -269,7 +273,7 @@ class LiME {
|
||||
window.on_focus(_event);
|
||||
|
||||
case SystemEvents.redraw:
|
||||
window.on_redraw(true);
|
||||
window.on_redraw(_event);
|
||||
|
||||
case SystemEvents.shouldrotate:
|
||||
window.on_should_rotate(_event);
|
||||
|
||||
@@ -38,6 +38,8 @@ class RenderHandler {
|
||||
public var lib : LiME;
|
||||
public function new( _lib:LiME ) { lib = _lib; }
|
||||
|
||||
public var __handle : Dynamic;
|
||||
|
||||
//direct_renderer_handle for drawing
|
||||
public var direct_renderer_handle : Dynamic;
|
||||
|
||||
@@ -47,15 +49,23 @@ class RenderHandler {
|
||||
public var canvas_position : Dynamic;
|
||||
#end //lime_html5
|
||||
|
||||
|
||||
@:noCompletion private function __onRender(rect:Dynamic):Void {
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function startup() {
|
||||
|
||||
#if lime_native
|
||||
|
||||
__handle = lime_get_frame_stage( lib.window_handle );
|
||||
|
||||
//Set up the OpenGL View
|
||||
direct_renderer_handle = lime_direct_renderer_create();
|
||||
|
||||
//Add this to the main stage, so it will render
|
||||
lime_doc_add_child( lib.view_handle, direct_renderer_handle );
|
||||
lime_doc_add_child( __handle, direct_renderer_handle );
|
||||
|
||||
//Set this handle to the real view with a render function
|
||||
lime_direct_renderer_set( direct_renderer_handle, on_render );
|
||||
@@ -218,27 +228,20 @@ class RenderHandler {
|
||||
|
||||
#if lime_html5
|
||||
|
||||
// trace('render.render');
|
||||
|
||||
on_render();
|
||||
|
||||
on_render(null);
|
||||
_requestAnimFrame( lib.on_update );
|
||||
|
||||
return true;
|
||||
#end
|
||||
|
||||
#if lime_native
|
||||
// trace("now doing render");
|
||||
// lime_stage_request_render();
|
||||
|
||||
lime_render_stage( lib.view_handle );
|
||||
// lime_stage_request_render();
|
||||
#end //lime_native
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function on_render() {
|
||||
public function on_render(rect:Dynamic):Void {
|
||||
|
||||
if( lib.host.render != null ) {
|
||||
lib.host.render();
|
||||
@@ -249,6 +252,7 @@ class RenderHandler {
|
||||
|
||||
//lime functions
|
||||
#if lime_native
|
||||
private static var lime_get_frame_stage = Libs.load("lime","lime_get_frame_stage", 1);
|
||||
private static var lime_stage_request_render = Libs.load("lime","lime_stage_request_render", 0);
|
||||
private static var lime_render_stage = Libs.load("lime","lime_render_stage", 1);
|
||||
private static var lime_doc_add_child = Libs.load("lime","lime_doc_add_child", 2);
|
||||
|
||||
@@ -224,6 +224,7 @@ class WindowHandler {
|
||||
}
|
||||
|
||||
public function on_redraw( _event:Dynamic ) {
|
||||
trace(_event);
|
||||
lib.render.render();
|
||||
} //on_redraw
|
||||
|
||||
|
||||
0
templates/neko/ndll/mac/libneko.dylib
Executable file → Normal file
0
templates/neko/ndll/mac/libneko.dylib
Executable file → Normal file
0
templates/neko/ndll/mac/regexp.ndll
Executable file → Normal file
0
templates/neko/ndll/mac/regexp.ndll
Executable file → Normal file
0
templates/neko/ndll/mac/sqlite.ndll
Executable file → Normal file
0
templates/neko/ndll/mac/sqlite.ndll
Executable file → Normal file
0
templates/neko/ndll/mac/std.ndll
Executable file → Normal file
0
templates/neko/ndll/mac/std.ndll
Executable file → Normal file
0
templates/neko/ndll/mac/zlib.ndll
Executable file → Normal file
0
templates/neko/ndll/mac/zlib.ndll
Executable file → Normal file
0
templates/neko/ndll/mac64/libneko.dylib
Executable file → Normal file
0
templates/neko/ndll/mac64/libneko.dylib
Executable file → Normal file
0
templates/neko/ndll/mac64/regexp.ndll
Executable file → Normal file
0
templates/neko/ndll/mac64/regexp.ndll
Executable file → Normal file
0
templates/neko/ndll/mac64/sqlite.ndll
Executable file → Normal file
0
templates/neko/ndll/mac64/sqlite.ndll
Executable file → Normal file
0
templates/neko/ndll/mac64/std.ndll
Executable file → Normal file
0
templates/neko/ndll/mac64/std.ndll
Executable file → Normal file
0
templates/neko/ndll/mac64/zlib.ndll
Executable file → Normal file
0
templates/neko/ndll/mac64/zlib.ndll
Executable file → Normal file
Reference in New Issue
Block a user