love icon indicating copy to clipboard operation
love copied to clipboard

love.graphics. print() not printing anything

Open atreyi13 opened this issue 4 years ago • 16 comments

So I am just just starting out with Love2d and I wrote two lines of code to print a statement using love.graphics.draw(). The moment I run it all I get is a blank screen. Please help me out.

function love.draw() love.graphics.print("Hello world") end

atreyi13 avatar Apr 10 '20 14:04 atreyi13

A few questions:

  • Which version of love are you using?

  • If you run the no-game screen, does that appear as expected (it should look like this https://love2d.org/w/images/9/9b/11.0-NoGame.png if love 11 is being used) or is it blank as well?

  • What OS and graphics card are you using? Are there any updated graphics drivers compared to what you have installed on your system?

slime73 avatar Apr 10 '20 14:04 slime73

  • I am using the latest version of love that is Love 11.3

  • I can see the no game screen just fine.

  • My OS is Windows 10 and I have recently updated my graphics driver.

atreyi13 avatar Apr 10 '20 14:04 atreyi13

What graphics card are you using?

slime73 avatar Apr 10 '20 14:04 slime73

I have Intel Iris plus Graphics

atreyi13 avatar Apr 10 '20 14:04 atreyi13

Try giving 2nd and 3rd parameters with x and y, shouldn't make a difference but just in case!

dmoa avatar Apr 12 '20 23:04 dmoa

I have the same problem with AMD ATI Radeon 3000 on Windows 10, text is not rendering at all. Everything works fine on Linux. Though this GPU is so old that it doesn't even meet Windows 10 minimum requirements, so it's no surprise to me.

theoratkin avatar May 21 '20 00:05 theoratkin

I have the same problem on Raspberry Pi 4 running Raspbian both with 11.1 and 11.3.

kgorlovsky avatar Jun 02 '20 12:06 kgorlovsky

For those of you who are running into this issue, can you run this code and take a screenshot of what the window looks like? It might help narrow down where the problem is:

love.graphics.setBackgroundColor(0.3, 0.3, 0.7)
love.graphics.setNewFont(20)

local shader = love.graphics.newShader[[
vec4 effect(vec4 vcolor, Image tex, vec2 texcoord, vec2 pixcoord) {
    return vec4(texcoord, 0.0, 1.0);
}
]]

function love.draw()
    love.graphics.setShader(shader)
    love.graphics.print("The quick brown fox jumps over the lazy dog", 20, 20)
    love.graphics.setShader()
    love.graphics.print("The quick brown fox jumps over the lazy dog", 20, 50)
end

Here's what it looks like on my computer: Screen Shot 2020-07-12 at 9 20 37 AM

slime73 avatar Jul 12 '20 12:07 slime73

@slime73 Here's what I'm getting.

2020-07-12_105317_01_ati_radeon_3000_love2d_font_not_rendering

theoratkin avatar Jul 12 '20 15:07 theoratkin

@thratkin thanks for testing. Can you paste the output of this? (You'll probably want to run it with lovec.exe instead of love.exe so the print call shows up in a command prompt.)

print(love.graphics.getRendererInfo())

slime73 avatar Jul 12 '20 15:07 slime73

@slime73 Here's the output.

OpenGL 3.3.11672 Core Profile Context ATI Technologies Inc. ATI Radeon 3000 Graphics

theoratkin avatar Jul 12 '20 21:07 theoratkin

Thanks. I think the commit I just pushed should work around the issue on your system (you'll be able to grab a build from here in a few minutes: https://ci.appveyor.com/project/AlexSzpakowski/love/builds/34053214/job/y5qisg6nk14905my/artifacts )

That commit only expands a driver bug workaround to more ATI/AMD GPUs, it won't change things for Intel or rpi GPUs – for those cases, the test code and getRendererInfo output might help, and I'd also suggest making sure the graphics drivers you're using are as up to date as possible.

slime73 avatar Jul 12 '20 21:07 slime73

@slime73 Yes, the text is now rendering properly on my system. Great job!

theoratkin avatar Jul 12 '20 22:07 theoratkin

@kgorlovsky @atreyi13 are you able to test with the code and debug output I outlined above (as well as testing a build of the latest 11.4 prerelease / git code, if possible)? I probably won't be able to figure out a workaround for your systems without more info.

slime73 avatar Dec 24 '20 17:12 slime73

@slime73 , not sure what voodoo your commit did, but I'd like to help solve this for even more graphics cards. My test window and output are identical to @thokr 's but this is still currently broken on my machine. What further digging can we do? As @thokr stated already though, we're practically trying to render on toasters so if you can't help I wont be that shocked.

suttonwilliamd avatar Dec 24 '21 05:12 suttonwilliamd

I'd like to help solve this for even more graphics cards. My test window and output are identical to @thokr 's but this is still currently broken on my machine.

So you're using the same GPU as thokr? If not, which GPU is it? Are you testing using a recent prerelease build of 11.4? You can grab one from here https://ci.appveyor.com/project/AlexSzpakowski/love/builds/41943056/job/sy46qxq16vms83xq/artifacts (or from here https://github.com/love2d/love/actions/runs/1597397190#artifacts).

slime73 avatar Dec 24 '21 15:12 slime73

I'm assuming love 11.4 fixed this for you, but if it hasn't please share your love.graphics.getRendererInfo output (like https://github.com/love2d/love/issues/1563#issuecomment-657239612).

slime73 avatar Dec 03 '22 22:12 slime73