blitting text and images

Started by raft, March 18, 2008, 10:34:21 PM

Previous topic - Next topic

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

EgonOlsen

You are constantly getting an exception thrown in the draw method, but the catch swallows it. Change

Logger.log("Drawing thread terminated!", Logger.MESSAGE);

to something like

Logger.log(e, Logger.MESSAGE);

to see the actual reason.

Kaiidyn

#32
It appears namePos2D is null sometimes..
namePos2D = Interact2D.project3D2D(Render.camera.getJpctCamera(), Render.frameBuffer, namePos3D);
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

EgonOlsen

Of course it is. Like the docs say:
QuoteReturns 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.

Kaiidyn

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

EgonOlsen

I thought that it might be useful to make this thread sticky...

raft

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

Darai

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.

raft

you cannot use desktop version for Android. there is a separate one for jPCT AE

Darai

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.