Results 1 to 10 of 10

Thread: beginNativePainting() with QPainter's shader (for transformation and opacity purpose)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2010
    Posts
    10
    Thanks
    1

    Default Re: beginNativePainting() with QPainter's shader (for transformation and opacity purp

    Quote Originally Posted by wysota View Post
    I don't know, make an example and find it out on your own. I don't even know if it works at all.
    After some testing..
    1.Will it cause any side-effect? If not, why Qt design this function?
    Not sure, but the projection seems wrong, the elements didn't draw in the position I wanted.

    2.Because I use shader program, too. Could we have two program at the same time?
    Yes, I still can use my own shader program.

    Finally, I give up this way and solve this problem by my own transformation matrix.

  2. #2
    Join Date
    Oct 2010
    Posts
    10
    Thanks
    1

    Default Re: beginNativePainting() with QPainter's shader (for transformation and opacity purp

    I think I have to apology first, after many study and experiments, I got a new conclusion now.
    For Qt painting framework, after calling the beginNativePainting(), the following gl commands will be affected by the shaders constructed by Qt(all transformation of coz)
    So, you don't have to do anything, and all the elements drawn by gl commands will also be rotate, flip and so on.

    The code I made in previous edition, I use some custom projection in openGL, so it looks like the previous shaders is not enabled, it is a wrong concept.

Similar Threads

  1. purpose of Q_GLOBAL_STATIC
    By raj_iv in forum Qt Programming
    Replies: 3
    Last Post: 15th July 2011, 14:20
  2. QPainter and Shader
    By shetan in forum Qt Programming
    Replies: 1
    Last Post: 5th April 2011, 08:33
  3. Geometry shader with QT4.7
    By saraksh in forum General Programming
    Replies: 3
    Last Post: 28th March 2011, 16:40
  4. Navigation purpose
    By jerkymotion in forum Qt Programming
    Replies: 6
    Last Post: 17th March 2011, 17:59
  5. How to make a general purpose storage class?
    By khikho in forum Qt Programming
    Replies: 1
    Last Post: 3rd February 2009, 23:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.