Author Topic: blitting text and images  (Read 53759 times)

Offline Kaiidyn

  • long
  • ***
  • Posts: 103
    • View Profile
Re: blitting text and images
« Reply #30 on: February 28, 2011, 06:30:11 pm »
see edit in previous post
Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control. - Grady Booch

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: blitting text and images
« Reply #31 on: February 28, 2011, 08:17:13 pm »
You are constantly getting an exception thrown in the draw method, but the catch swallows it. Change

Code: [Select]
Logger.log("Drawing thread terminated!", Logger.MESSAGE);
to something like

Code: [Select]
Logger.log(e, Logger.MESSAGE);
to see the actual reason.

Offline Kaiidyn

  • long
  • ***
  • Posts: 103
    • View Profile
Re: blitting text and images
« Reply #32 on: February 28, 2011, 08:27:57 pm »
It appears namePos2D is null sometimes..
Code: [Select]
namePos2D = Interact2D.project3D2D(Render.camera.getJpctCamera(), Render.frameBuffer, namePos3D);
« Last Edit: February 28, 2011, 08:33:56 pm by Kaiidyn »
Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control. - Grady Booch

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: blitting text and images
« Reply #33 on: February 28, 2011, 08:45:43 pm »
Of course it is. Like the docs say:
Quote
Returns null if the transformation can't be done (i.e. the vertex is behind the viewplane).

...or that's at least what the docs should say. What they actually say, is something about the center being behind the viewplane...i'll correct this. Anyway, it can be null. If it is, your draw thread crashes causing the creation of new visibility lists over and over again leading to an out of memory after a while.

Offline Kaiidyn

  • long
  • ***
  • Posts: 103
    • View Profile
Re: blitting text and images
« Reply #34 on: February 28, 2011, 09:05:30 pm »
Ya, fixed it by surrounding if namePos2D != null :)
Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control. - Grady Booch

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: blitting text and images
« Reply #35 on: January 19, 2012, 07:56:49 am »
I thought that it might be useful to make this thread sticky...

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: blitting text and images
« Reply #36 on: February 03, 2012, 03:20:18 pm »
yes. that's because android does not have awt classes.

GlFont and TexturePack has Android versions. search for them in forum or Bones demo also has them

Offline Darai

  • byte
  • *
  • Posts: 45
    • View Profile
Blitting text and images - Still old blit even after 7 years?
« Reply #37 on: January 20, 2016, 02:50:32 pm »
Hello,

I am experimenting with this extremly helpful piece of code, but up until now I had only little luck.
1) I copied the classes GLFont and TexturePack from the first post
2) I solved the class dependency of java.awt by adding Project->Properties->Java Build Path->Add Library->JRE System library

But I am still getting two errors in the TexturePack:
the constructor jpct.Texture(BufferedImage(image), Boolean(useAlpha)) is undefined
the function com.threed.jpct.FrameBuffer.blit is not defined for parameters ...

I expect that this can have something to do with your information from the first post that you used the experimental jpct... but
1) That was 7 years ago
2) Your link for the experimental beta jpct doesn't work any more

So I am intrigued to know - is the "experimental" jpct version of blit and Texture now reachable somewhere else? or did you reprogrammed it for the classic jpct_ae? Or how can I solve this code now in 2016?

Thanks,
Darai.

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: blitting text and images
« Reply #38 on: January 20, 2016, 02:55:06 pm »
you cannot use desktop version for Android. there is a separate one for jPCT AE

Offline Darai

  • byte
  • *
  • Posts: 45
    • View Profile
Re: blitting text and images
« Reply #39 on: January 20, 2016, 03:03:36 pm »
Thanks a lot,

I just found myself that in the Android forum is a different version. As usually the problem was something trivial on my side.
Well, thanks a million time for the nice work, I will experiment with it and ask if I will need more help.

Cheers,
Darai.