FFI - Using OpenGL.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Nequenz
Prole
Posts: 2
Joined: Mon Sep 14, 2015 5:33 pm

FFI - Using OpenGL.

Post by Nequenz »

Hello everyone i downloaded the file 'OpenGL.lua' from GitHub and i'm trying to use OpenGL in Love project just it's interesting. But 'glColor3f\i(r,g,b)' doesn't work i see the black triangle but 'glClearColor" works great maybe someone knows what is the problem.
P.S sorry for my broken english, i'm just from Russia...
Attachments
3DTesting2.zip
(16.49 KiB) Downloaded 109 times
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: FFI - Using OpenGL.

Post by slime »

In LÖVE 0.9.2 and below, love.graphics.setColor calls glColor itself, which will overwrite your glColor call. LÖVE also sets an orthographic projection matrix in the GL_PROJECTION matrix stack with a size equal to the window's size, so your triangle is probably showing up, just at a very small size in the top-left corner of the screen.

If you want to use raw OpenGL with LÖVE, you probably shouldn't mix it with any love.graphics function unless you know the source code of love.graphics very well, since most love.graphics functions modify a lot of OpenGL state and expect the state to be unmodified in between calls. Even just having love.graphics loaded with a window open will cause the OpenGL state to be modified.

Because of that, I'd probably use something other than LÖVE if you want to use OpenGL directly.
Nequenz
Prole
Posts: 2
Joined: Mon Sep 14, 2015 5:33 pm

Re: FFI - Using OpenGL.

Post by Nequenz »

slime wrote:In LÖVE 0.9.2 and below, love.graphics.setColor calls glColor itself, which will overwrite your glColor call. LÖVE also sets an orthographic projection matrix in the GL_PROJECTION matrix stack with a size equal to the window's size, so your triangle is probably showing up, just at a very small size in the top-left corner of the screen.

If you want to use raw OpenGL with LÖVE, you probably shouldn't mix it with any love.graphics function unless you know the source code of love.graphics very well, since most love.graphics functions modify a lot of OpenGL state and expect the state to be unmodified in between calls. Even just having love.graphics loaded with a window open will cause the OpenGL state to be modified.

Because of that, I'd probably use something other than LÖVE if you want to use OpenGL directly.
Thank you for help:3
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests