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
|
//Create a set of vertices
|
||||||
var vertices : Float32Array = new Float32Array([
|
var vertices : Float32Array = new Float32Array([
|
||||||
100, 100, 0,
|
100.0, 100.0, 0.0,
|
||||||
-100, 100, 0,
|
-100.0, 100.0, 0.0,
|
||||||
100, -100, 0,
|
100.0, -100.0, 0.0,
|
||||||
-100, -100, 0
|
-100.0, -100.0, 0.0
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//Create a buffer from OpenGL
|
//Create a buffer from OpenGL
|
||||||
vertexBuffer = GL.createBuffer ();
|
vertexBuffer = GL.createBuffer();
|
||||||
//Bind it
|
//Bind it
|
||||||
GL.bindBuffer (GL.ARRAY_BUFFER, vertexBuffer);
|
GL.bindBuffer( GL.ARRAY_BUFFER, vertexBuffer );
|
||||||
//Point it to the vertex array!
|
//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
|
} //init
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class InputHandler {
|
|||||||
touch_map = new Map<Int, Dynamic>();
|
touch_map = new Map<Int, Dynamic>();
|
||||||
down_keys = new Map();
|
down_keys = new Map();
|
||||||
|
|
||||||
#if lime_html5
|
#if lime_html5
|
||||||
lime_apply_input_listeners();
|
lime_apply_input_listeners();
|
||||||
#end //lime_html5
|
#end //lime_html5
|
||||||
}
|
}
|
||||||
@@ -154,7 +154,6 @@ class InputHandler {
|
|||||||
last_mouse_x = _event.x;
|
last_mouse_x = _event.x;
|
||||||
last_mouse_y = _event.y;
|
last_mouse_y = _event.y;
|
||||||
|
|
||||||
// trace("mouse moved, new : " + _event.x + ' ' + _event.y);
|
|
||||||
// trace("mouse moved, delta : " + deltaX + ' ' + deltaY);
|
// trace("mouse moved, delta : " + deltaX + ' ' + deltaY);
|
||||||
|
|
||||||
if(lib.host.onmousemove != null) {
|
if(lib.host.onmousemove != null) {
|
||||||
|
|||||||
10
lime/LiME.hx
10
lime/LiME.hx
@@ -67,9 +67,13 @@ class LiME {
|
|||||||
_debug(':: lime :: initializing -');
|
_debug(':: lime :: initializing -');
|
||||||
_debug(':: lime :: Creating window at ' + config.width + 'x' + config.height);
|
_debug(':: lime :: Creating window at ' + config.width + 'x' + config.height);
|
||||||
|
|
||||||
//default to 60 fps
|
//default to 60 fps
|
||||||
if( config.fps != null ) {
|
if( config.fps != null ) {
|
||||||
frame_rate = Std.parseFloat( config.fps );
|
if(Std.is(config.fps, String)) {
|
||||||
|
frame_rate = Std.parseFloat( config.fps );
|
||||||
|
} else {
|
||||||
|
frame_rate = config.fps;
|
||||||
|
}
|
||||||
} else { //config.fps
|
} else { //config.fps
|
||||||
frame_rate = 60;
|
frame_rate = 60;
|
||||||
}
|
}
|
||||||
@@ -269,7 +273,7 @@ class LiME {
|
|||||||
window.on_focus(_event);
|
window.on_focus(_event);
|
||||||
|
|
||||||
case SystemEvents.redraw:
|
case SystemEvents.redraw:
|
||||||
window.on_redraw(true);
|
window.on_redraw(_event);
|
||||||
|
|
||||||
case SystemEvents.shouldrotate:
|
case SystemEvents.shouldrotate:
|
||||||
window.on_should_rotate(_event);
|
window.on_should_rotate(_event);
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ class RenderHandler {
|
|||||||
public var lib : LiME;
|
public var lib : LiME;
|
||||||
public function new( _lib:LiME ) { lib = _lib; }
|
public function new( _lib:LiME ) { lib = _lib; }
|
||||||
|
|
||||||
|
public var __handle : Dynamic;
|
||||||
|
|
||||||
//direct_renderer_handle for drawing
|
//direct_renderer_handle for drawing
|
||||||
public var direct_renderer_handle : Dynamic;
|
public var direct_renderer_handle : Dynamic;
|
||||||
|
|
||||||
@@ -47,15 +49,23 @@ class RenderHandler {
|
|||||||
public var canvas_position : Dynamic;
|
public var canvas_position : Dynamic;
|
||||||
#end //lime_html5
|
#end //lime_html5
|
||||||
|
|
||||||
|
|
||||||
|
@:noCompletion private function __onRender(rect:Dynamic):Void {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function startup() {
|
public function startup() {
|
||||||
|
|
||||||
#if lime_native
|
#if lime_native
|
||||||
|
|
||||||
|
__handle = lime_get_frame_stage( lib.window_handle );
|
||||||
|
|
||||||
//Set up the OpenGL View
|
//Set up the OpenGL View
|
||||||
direct_renderer_handle = lime_direct_renderer_create();
|
direct_renderer_handle = lime_direct_renderer_create();
|
||||||
|
|
||||||
//Add this to the main stage, so it will render
|
//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
|
//Set this handle to the real view with a render function
|
||||||
lime_direct_renderer_set( direct_renderer_handle, on_render );
|
lime_direct_renderer_set( direct_renderer_handle, on_render );
|
||||||
@@ -218,27 +228,20 @@ class RenderHandler {
|
|||||||
|
|
||||||
#if lime_html5
|
#if lime_html5
|
||||||
|
|
||||||
// trace('render.render');
|
on_render(null);
|
||||||
|
|
||||||
on_render();
|
|
||||||
|
|
||||||
_requestAnimFrame( lib.on_update );
|
_requestAnimFrame( lib.on_update );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
#end
|
#end
|
||||||
|
|
||||||
#if lime_native
|
#if lime_native
|
||||||
// trace("now doing render");
|
|
||||||
// lime_stage_request_render();
|
|
||||||
|
|
||||||
lime_render_stage( lib.view_handle );
|
lime_render_stage( lib.view_handle );
|
||||||
// lime_stage_request_render();
|
|
||||||
#end //lime_native
|
#end //lime_native
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function on_render() {
|
public function on_render(rect:Dynamic):Void {
|
||||||
|
|
||||||
if( lib.host.render != null ) {
|
if( lib.host.render != null ) {
|
||||||
lib.host.render();
|
lib.host.render();
|
||||||
@@ -249,6 +252,7 @@ class RenderHandler {
|
|||||||
|
|
||||||
//lime functions
|
//lime functions
|
||||||
#if lime_native
|
#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_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_render_stage = Libs.load("lime","lime_render_stage", 1);
|
||||||
private static var lime_doc_add_child = Libs.load("lime","lime_doc_add_child", 2);
|
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 ) {
|
public function on_redraw( _event:Dynamic ) {
|
||||||
|
trace(_event);
|
||||||
lib.render.render();
|
lib.render.render();
|
||||||
} //on_redraw
|
} //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