Hi,

Am 30.09.2013 12:51, schrieb Sean Harmer:
Hi,

On Sunday 29 September 2013 16:12:48 Thomas Meyer wrote:
thank you very much!
You're welcome.

(I have read your 5 parts article:
http://www.kdab.com/opengl-in-qt-5-1-part-1/
and tried the terrain_tessellation project
http://www.kdab.com/~sean/terrain_tessellation.zip [awesome])

I want to use the QGLWidget, because I get 'artefacts' if
I use QPainter's drawText in QWindow and it is possible to
add QGLWidget as central widget in QMainWindow.
With the QWindow I can only render something (I think) and
found no solution to add it to something or to use buttons, sliders etc.

Before I got your answer, I found a solution:
http://qt-project.org/wiki/How_to_use_OpenGL_Core_Profile_with_Qt
https://svn.theharmers.co.uk/svn/codes/public/opengl/trunk/07-core-profile/
and
http://qt-project.org/forums/viewthread/16041/#90717

So, if I want to use the 'glTextureView' (Core since version 4.3,
http://www.opengl.org/wiki/GLAPI/glTextureView) in GLWidget:
...
voidGLWidget::initializeGL(void)

{

...
typedefvoid(APIENTRY*_glTextureView)(GLuint,GLenum,GLuint,GLenum,GLuint,GLui
nt,GLuint,GLuint);


_glTextureViewglTextureView;

glTextureView=(_glTextureView)context()->getProcAddress("glTextureView");

if(glTextureView!=NULL)
{
qDebug()<<Q_FUNC_INFO<<"glTextureView!=NULL";
}
...
I have not used the function, but this code works for me.
In all seriousness, unless you actually enjoy resolving function pointers I
would just use QOpenGLFunctions_4_3_Core. It will make your life much easier.
That's true! I have replaced the typedef's to bind a VAO with:
...
uintvao;

funcs->glGenVertexArrays(1,&vao);
funcs->glBindVertexArray(vao);
...


Thanks again,
 Thomas
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to