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...
FFI - Using OpenGL.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
FFI - Using OpenGL.
- Attachments
-
- 3DTesting2.zip
- (16.49 KiB) Downloaded 109 times
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: FFI - Using OpenGL.
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.
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.
Re: FFI - Using OpenGL.
Thank you for help:3slime 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.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests