Author Topic: strange problem with blitString and blit  (Read 4868 times)

Offline bili

  • byte
  • *
  • Posts: 39
    • View Profile
strange problem with blitString and blit
« on: April 01, 2012, 03:12:52 am »
If I do blitString before blit texture then only the texture shows ...but if its other way around, only strings shows  :o

Any advice plz?

Edit1: I should mention that I use a skybox also.
Edit2: ha! If i comment out skybox in rendering loop, everything shows up ...but I still need the skybox.
« Last Edit: April 01, 2012, 03:23:56 pm by bili »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: strange problem with blitString and blit
« Reply #1 on: April 01, 2012, 09:29:59 pm »
What is blitString? There's no such method in jPCT-AE? Can you post the render part of your code?

Offline bili

  • byte
  • *
  • Posts: 39
    • View Profile
Re: strange problem with blitString and blit
« Reply #2 on: April 01, 2012, 09:55:23 pm »
blitString is from glfront package that comes Bones. Here is my rendering part:
Code: [Select]
frameBuffer.clear(back);
skybox.render(world, frameBuffer); // render the skybox
flower.warning(frameBuffer, displayLevel);
displayLevel.blitString(frameBuffer, "-", frameBuffer.getWidth()-30, 50, 10, null);
displayLevel.blitString(frameBuffer, "+", frameBuffer.getWidth()-30, 150, 10, null);
frameBuffer.blit(trophy, 0, 0, 15, 30, 32, 32, true);
world.renderScene(frameBuffer);
world.draw(frameBuffer);
frameBuffer.display();

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: strange problem with blitString and blit
« Reply #3 on: April 01, 2012, 10:16:33 pm »
I fail to see the relation between a blit and the skybox...??? What happens if you do two simple blits instead of these string blits? Which version are you using? Have you tried the latest beta? Which OpenGL version are you using? 1.1 or 2.0?

Offline bili

  • byte
  • *
  • Posts: 39
    • View Profile
Re: strange problem with blitString and blit
« Reply #4 on: April 01, 2012, 10:58:13 pm »
If I blit just the skybox and the texture then it's fine. Everything shown. Im' using OpenGL version 1.1.  Haven't tried latest beta. I use jpct version 1.24 or something like that.  Do you have links for beta?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: strange problem with blitString and blit
« Reply #5 on: April 01, 2012, 11:06:19 pm »
If I blit just the skybox and the texture then it's fine. Everything shown. Im' using OpenGL version 1.1.  Haven't tried latest beta. I use jpct version 1.24 or something like that.  Do you have links for beta?
You don't "blit" a skybox...so this isn't the actual answer to my question. What i meant was to replace the blitString()-calls by some other, "normal" blits. Here's the latest beta: http://jpct.de/download/beta/jpct_ae.jar

Offline bili

  • byte
  • *
  • Posts: 39
    • View Profile
Re: strange problem with blitString and blit
« Reply #6 on: April 01, 2012, 11:18:33 pm »
Ah! With two normal blits, only the second one is displayed  :o And that is strange because I had blit-ted four blits before and everything worked.
« Last Edit: April 01, 2012, 11:21:41 pm by bili »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: strange problem with blitString and blit
« Reply #7 on: April 02, 2012, 02:43:47 pm »
Does it work if you do the blits AFTER rendering the scene? If so, then there might a bug in the batching of the blits....

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: strange problem with blitString and blit
« Reply #8 on: April 02, 2012, 09:34:28 pm »
I've updated the beta jar with a version that might fix the problem. Please give it a try: http://jpct.de/download/beta/jpct_ae.jar

Offline bili

  • byte
  • *
  • Posts: 39
    • View Profile
Re: strange problem with blitString and blit
« Reply #9 on: April 02, 2012, 10:49:31 pm »
Thanks! it works now. I put blits after the rendering the scene and everything shows up again!   :)

Cheers!