VirtualBox

Ignore:
Timestamp:
Aug 3, 2009 7:43:37 PM (15 years ago)
Author:
vboxsync
Message:

Video Hw Accel: basics for NP2 & RECTANGLE textures support, workaround for NVIDIA driver bug with GLSL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h

    r21939 r21950  
    666666    VBoxVHWATexture() {}
    667667    VBoxVHWATexture(const QRect * pRect, const VBoxVHWAColorFormat *pFormat);
    668     void init(uchar *pvMem);
     668//    virtual ~VBoxVHWATexture();
     669    virtual void init(uchar *pvMem);
    669670    void setAddress(uchar *pvMem) {mAddress = pvMem;}
    670     void uninit();
    671     void update(const QRect * pRect);
    672     GLuint texture() {return mTexture;}
     671    virtual void update(const QRect * pRect);
     672    void bind() {glBindTexture(texTarget(), mTexture);}
     673
     674    virtual void texCoord(int x, int y);
     675    virtual void multiTexCoord(GLenum texUnit, int x, int y);
     676
     677//    GLuint texture() {return mTexture;}
    673678    const QRect & texRect() {return mTexRect;}
    674679    const QRect & rect() {return mRect;}
     
    684689    int toYTex(int y) {return y/mColorFormat.heightCompression();}
    685690    ulong memSize(){ return mBytesPerLine * mRect.height()/mColorFormat.heightCompression(); }
    686 private:
     691
     692    void uninit();
     693
     694protected:
     695    virtual void initParams();
     696    virtual void load();
     697    virtual GLenum texTarget() {return GL_TEXTURE_2D; }
     698
     699
     700    QRect mTexRect; /* texture size */
     701    QRect mRect; /* img size */
    687702    uchar * mAddress;
    688703    GLuint mTexture;
    689704    uint32_t mBytesPerPixel;
    690705    uint32_t mBytesPerLine;
    691     QRect mTexRect; /* texture size */
    692     QRect mRect; /* img size */
    693706    VBoxVHWAColorFormat mColorFormat;
     707};
     708
     709class VBoxVHWATextureNP2 : public VBoxVHWATexture
     710{
     711public:
     712    VBoxVHWATextureNP2() : VBoxVHWATexture() {}
     713    VBoxVHWATextureNP2(const QRect * pRect, const VBoxVHWAColorFormat *pFormat) :
     714        VBoxVHWATexture(pRect, pFormat){
     715        mTexRect = *pRect;
     716    }
     717protected:
     718};
     719
     720class VBoxVHWATextureNP2Rect : public VBoxVHWATextureNP2
     721{
     722public:
     723    VBoxVHWATextureNP2Rect() : VBoxVHWATextureNP2() {}
     724    VBoxVHWATextureNP2Rect(const QRect * pRect, const VBoxVHWAColorFormat *pFormat) :
     725        VBoxVHWATextureNP2(pRect, pFormat){}
     726
     727    virtual void texCoord(int x, int y);
     728    virtual void multiTexCoord(GLenum texUnit, int x, int y);
     729protected:
     730    virtual GLenum texTarget();
    694731};
    695732
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette