[xinf] xing 0.0.6, was: xinf 0.0.5 -D gldebug
Zjnue Brzavi
zjnue.brzavi at googlemail.com
Thu Mar 22 14:22:46 CET 2007
hi
> i'm a bit reluctant to increase releases sooo quick..
damn, i thought we'd be on 1.0 soon this way :)
did both changes, recompiled sample 1, still no change i'm afraid.
XinfinityRuntime > display() now is:
public function display() :Void {
startFrame();
// FIXME: here??
Font.cacheGlyphs();
#if gldebug
var e:Int = GL.getError();
if( e > 0 ) {
throw( "OpenGL Error: "+opengl.GLU.errorString(e) );
}
#end
somethingChanged = false;
renderRoot();
// TODO precise timing here
endFrame();
}
and Font > textSize now is:
public function textSize( text:String, fontSize:Float ) :{x:Float,y:Float} {
var lines=0;
var lineHeight = Math.round(height*fontSize)/fontSize;
var w=0.0;
var maxW=0.0;
for( i in 0...text.length ) {
var c = text.charCodeAt(i);
if( c == 10 ) { // \n
if( w>maxW ) maxW = w;
w=0;
lines++;
//GL.translate( .0, lineHeight*lines, .0 );
} else {
var g = getGlyph(c);
if( g != null ) {
w += g.advance;
}
}
}
if( w>maxW ) maxW=w;
maxW*=fontSize;
return { x:maxW, y:(lines+1)*(lineHeight*fontSize) };
}
output:
C:\Program Files\Motion-Twin\haxe\lib\xinf\0,0,6\samples\1-helloworld>neko run.n
GLDebugRenderer.hx:39: showObject [1]
GLDebugRenderer.hx:39: startNative [#1]
GLDebugRenderer.hx:39: showObject [8]
GLDebugRenderer.hx:39: endNative null
GLDebugRenderer.hx:39: startObject [8]
GLDebugRenderer.hx:39: setFill [1, 1, 1, 0.5]
GLDebugRenderer.hx:39: rect [0, 0, 500, 500]
GLDebugRenderer.hx:39: setFill [1, 1, 1, 1]
GLDebugRenderer.hx:39: text [0, 0, Hello, World!, { bold => false, font => [Font
: Bitstream Vera Sans], size => 12, dirty => false, family => _sans, italic => f
alse }]
GLDebugRenderer.hx:39: endObject null
GLDebugRenderer.hx:39: setTranslation [8, 0, 0]
GLDebugRenderer.hx:39: showObject [1]
Called from <null> line 1
Called from App.hx line 31
Called from xinf/ony/Application.hx line 49
Called from xinf/inity/XinfinityRuntime.hx line 81
Called from xinf/inity/XinfinityRuntime.hx line 102
Called from xinf/inity/XinfinityRuntime.hx line 65
Called from xinf/inity/GLDebugRenderer.hx line 70
Called from xinf/inity/GLDebugRenderer.hx line 42
Uncaught exception - OpenGL Error on showObject [1]: invalid operation
More information about the xinf
mailing list