https://linen.dev logo
Join DiscordCommunities
Powered by
# openfl
  • a

    ambitious-knife-25690

    12/16/2022, 1:03 AM
    you should ask your flixel questions in #165234904815239168 redacted
  • f

    fast-ice-36271

    12/16/2022, 1:04 AM
    Txt*
  • a

    ambitious-knife-25690

    12/16/2022, 1:05 AM
    i'm not sure how text is displayed in openfl
  • a

    ambitious-knife-25690

    12/16/2022, 1:05 AM
    but essentially what you'd want to do is the following:
  • a

    ambitious-knife-25690

    12/16/2022, 1:10 AM
    1) Create the text object in your class to reference 2) Initialise that text object in your constructor 3) create a function in your class with:
    Copy code
    hx
    inline function formatTime() {
      return DateTools.format(Date.now(), '%r');
    }
    4) In your update loop do something like
    Copy code
    hx
    this.text_label.text = formatTime();
  • t

    thousands-state-46635

    12/16/2022, 5:42 PM
    hey, i didnt see thies message, so sorry - here's the output https://pastebin.com/0qQs5qqp
  • h

    hallowed-ocean-84954

    12/16/2022, 5:45 PM
    no worries. Ok this all looks standard and there doesn't appear to be any other error as you said. So I forget the original question. Was it just about the output or is something also not working ?
  • t

    thousands-state-46635

    12/16/2022, 5:47 PM
    Nope, its just the output
  • t

    thousands-state-46635

    12/16/2022, 5:47 PM
    Code works all well afaik
  • h

    hallowed-ocean-84954

    12/16/2022, 5:48 PM
    I vaguely remember someone reporting an issue with debug being printed when it wasn't needed but I never saw it myself and never tracked down when it happened
  • t

    thousands-state-46635

    12/16/2022, 5:49 PM
    ah
  • t

    thousands-state-46635

    12/16/2022, 5:50 PM
    assuming its coming from this function
    Copy code
    hx
        // }
        @:noCompletion private function __createGLShader(source:String, type:Int):GLShader
        {
            var gl = __context.gl;
    
            var shader = gl.createShader(type);
            gl.shaderSource(shader, source);
            gl.compileShader(shader);
            var shaderInfoLog = gl.getShaderInfoLog(shader);
            var hasInfoLog = shaderInfoLog != null && StringTools.trim(shaderInfoLog) != "";
            var compileStatus = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
    
            if (hasInfoLog || compileStatus == 0)
            {
                var message = (compileStatus == 0) ? "Error" : "Info";
                message += (type == gl.VERTEX_SHADER) ? " compiling vertex shader" : " compiling fragment shader";
                message += "\n" + shaderInfoLog;
                message += "\n" + source;
                if (compileStatus == 0) Log.error(message);
                else if (hasInfoLog) Log.debug(message);
            }
    
            return shader;
        }
  • h

    hallowed-ocean-84954

    12/16/2022, 5:50 PM
    ok so in there is a print of debug info. In your case you see "info"
  • h

    hallowed-ocean-84954

    12/16/2022, 5:50 PM
    yeah that
  • t

    thousands-state-46635

    12/16/2022, 5:51 PM
    how would i disable it though?
  • h

    hallowed-ocean-84954

    12/16/2022, 5:51 PM
    not sure exactly - I'm not sure why it's printing
  • r

    rhythmic-wolf-50922

    12/16/2022, 5:51 PM
    there was a commit recently to disable debug shader info in JS: https://github.com/openfl/openfl/commit/5dbaefa7d4d89eff9870f05b72f0494d571c2507
  • h

    hallowed-ocean-84954

    12/16/2022, 5:51 PM
    that's the thing
  • r

    rhythmic-wolf-50922

    12/16/2022, 5:52 PM
    it hasn't been included in a release yet
  • t

    thousands-state-46635

    12/16/2022, 5:52 PM
    Oh thats interesting - the issue seems to also occur on native builds too
  • t

    thousands-state-46635

    12/16/2022, 5:53 PM
    Should I use the github version then?
  • t

    thousands-state-46635

    12/16/2022, 5:54 PM
    will test it out
  • h

    hallowed-ocean-84954

    12/16/2022, 5:54 PM
    oh that's it - it was dumping debug even though the shaderlog was empty
  • h

    hallowed-ocean-84954

    12/16/2022, 5:54 PM
    the fix looks general not just js
  • r

    rhythmic-wolf-50922

    12/16/2022, 5:55 PM
    right now, the develop branch on Github contains only bug fixes since the last release, so it should be very stable
  • t

    thousands-state-46635

    12/16/2022, 6:02 PM
    For some reason it's still printing out all the debug stuff...
  • t

    thousands-state-46635

    12/16/2022, 6:02 PM
    even though the haxelib git updated the Shader.hx file
  • t

    thousands-state-46635

    12/16/2022, 6:02 PM
    Copy code
    hx
        @:noCompletion private function __createGLShader(source:String, type:Int):GLShader
        {
            var gl = __context.gl;
    
            var shader = gl.createShader(type);
            gl.shaderSource(shader, source);
            gl.compileShader(shader);
            var shaderInfoLog = gl.getShaderInfoLog(shader);
            var hasInfoLog = shaderInfoLog != null && StringTools.trim(shaderInfoLog) != "";
            var compileStatus = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
    
            if (hasInfoLog || compileStatus == 0)
            {
                var message = (compileStatus == 0) ? "Error" : "Info";
                message += (type == gl.VERTEX_SHADER) ? " compiling vertex shader" : " compiling fragment shader";
                message += "\n" + shaderInfoLog;
                message += "\n" + source;
                if (compileStatus == 0) Log.error(message);
                else if (hasInfoLog) Log.debug(message);
            }
    
            return shader;
        }
  • h

    hallowed-ocean-84954

    12/16/2022, 6:27 PM
    so I would add some debug prints for hasInfoLog and compileStatus and see what they are
  • h

    hallowed-ocean-84954

    12/16/2022, 11:52 PM
    @thousands-state-46635 thinking more on this I wonder now if the warning about the version is ending up in the shaderInfoLog and then causing everything else to be dumped. If it is then this fix above won't help because the shaderInfoLog is not empty. Actually that seems likely given what is being printed. You could prove it with debug prints but what is there basically proves that anyway. So if that's true then the next question is, how are you creating the shader ?
1...202122...57Latest