Font renderer : Nothing appear to the screen !

Started by Yuri6037, November 01, 2013, 16:48:26

Previous topic - Next topic

Yuri6037

I tried to make a font renderer, I arived to create one but nothing is appearing to the screen ! I have verified all the rendering code, LWJGL initialization, Crach Reporter, Display creator and BrickBroken Launcher, but the method is correctly called and display is ok and the rendering code too. I have seen the CrashReporter but no errors are detected. So i don't understand why nothing is appearing to the screen !

Here is the text rendering code (renderEngine is RenderEngine or the main game render engine class) :


--PRIVATE--


Thanks by advance,
Yuri6037

Yuri6037

Nobody knows why my code is giving me nothing ?

I realy need that code to work for finishing the new version of my game !

Yuri6037

Nobody...
So my game will never been finished...

I don't understand why nobody knows that !


Please let me know if nobody can help ! I have to know if I need to close or not this topic !

abcdef

Yuri6037

You don't really make it easy for people to comment.

1) We have no idea if you have a texture loaded correctly and that it contains text
2) Have you tried passing in a texture you know works to test whether it displays anything?
3) Have you tried putting your texture in a piece of code that you know works and can display textures
4) Have you got all your Open GL flags setup correctly?

Yuri6037

Thanks for answer,
Like I have said before, the render engine which contains mounting textures voids, is functioning. Otherwise the main class brick broken will not be able to load ! The font texture is 1024 by 1024 (it contains all chars in ASCII code), maybe it's gl constants at game init.
Like I said the whole game renders correctly only texts are not drew !
If you want I can post the lwjgl initialization void.


Wrote with my iPad,
Yuri6037

quew8


Yuri6037

So, here's the LWJGL initialization :
--PRIVATE--


Thanks for answer,
Yuri6037

Yuri6037

Allways nobody !

I don't know how to fix that ! Please help !

Would you wan't some other code ask me for the code you wan't !

I can give you the RenderEngine code if you wan't ! But if I post the render engine here, please not to copy - paste it for your 2d games projects ! Ok ?

I have spend many time on creating this RenderEngine, so please not kill this project...

Here is the RenderEngine class :
--PRIVATE--


Now ColorRenderer class :
--PRIVATE--


And the FontRenderer class :
--PRIVATE--


And in if you wan't, here is the textures :
The missing texture file (32 by 32) :
--You do not have permission to access StoneLine servers--
Now the font texture file (1024 by 1024) :
--You do not have permission to access StoneLine servers--

Thanks by advance,
And another time please not copy these codes, I give you the permission for view and test these codes but you may not bring these for you. Otherwise you will kill the BrickBroken project !

Yuri6037

quew8

Look: if no one sees any problems in your code and no one has any ideas, then we cannot help. I'm going to write a little, self contained exemplar for you. I will actually write this up in an IDE and compile and run it to ensure it works. Hopefully you'll be able to compare and contrast that with your own to see what the problem might be. I'll post it up when I'm done.

Your "font texture file" doesn't seem to contain anything. It would be easier for me to have one but I don't particularly want to bother making my own.

Yuri6037

That's normal because letters are white it seams like your screen make the forum white !
You need right clicking + save image or simply go in this link :
--You do not have permission to access StoneLine servers-- --> Font texture
--You do not have permission to access StoneLine servers-- --> Missing texture

quew8

Oh yeah. I just looked at it on my phone and I can see it on there but not on my desktop. I'll add it to the list of annoyances with Chrome (it only brings the list to 2). I did actually download it but Window's #%£#!! ing image preview thing didn't show me anything either. Why do I ever rely on Windows? OK, I'll get back to programming.

quew8

So here it is. http://pastebin.com/80NSu3pL. Use as much or as little as you like. If there is any particular thing you don't understand then I can explain it. If you find whatever it is in your code that is stopping your renderer working, then I can probably explain that too. But just to stress, this works. I've tested it. It's a little simplistic and I would never even think about releasing this as production code but it should suit your purposes. The idea of it is a self-contained and (more or less) minimalistic example.

In terms of debugging, I think I have given you about as much help as is possible. Certainly as much as I am willing.

Yuri6037

Thank you very much for taking your time to do this code for me...

But I'm so sorry to say you that : It's not working ! Nothing appear to the screen !

No errors ! I have simply replace my function by your function but nothing ! Nothing ! I think my graphic card simple does not handles text position with floats !

If you have another solution tell me. If you need some other codes, ask me. I'm realy lost ! I can not find any solution to resolve this problem. I have tried a solution that was working : drawing text without texture but with quads (and strangely with floats for coords and size) !

I don't know what I can do !

Here is the new code of FontRenderer class :
--PRIVATE--

quew8

The idea was to compare the two for anything that's different. Anything that is could be the cause of the problem. Try running the example on its own. See if it works then.

Yuri6037

Your example is working a lot of !
No lags !
I got about 1200 FPS !


And I have advanced a little !

When I was developping for Minecraft with Minecraft Forge, I needed to implement another Gui part.

When I have tried to draw some texts, I got nothing, like BrickBroken ! And after putting two unknown functions the text appeared : --PRIVATE-- and --PRIVATE--.

Do you understand now ?
The problem is that when putting these methods in BrickBroken, colored Quads are not rendered or rendered with transparency, so I don't know how I can implement these functions.

Yuri6037

EDIT : TESTED but nothing on the screen same problem ! I don't know. We have tested all we can but always nothing on the screen !

EDIT2 : YEEEEEEAAAAAAAAHHHHHH !!!! I have found the origin of the main problem ! Here :
There are two problematics lines of codes :
- one line of initialization who reduce the text two verry little not readable : --PRIVATE--;
- and this line kill the text : --PRIVATE-- (only change the x - y coords by 0,0)
Please help me !

EDIT3 : It seams that changing y coord may kill the text ! But questions are : WHY ? WTF ?!