Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - dartosgamer

Pages: [1]
1
Graphics / loading a png from sf::Image to an openGL useable format
« on: July 01, 2013, 03:06:51 pm »
I just got started with opengl so forgive me if I am missing something huge.

I am trying to load a 128x128 png into a simple opengl context. I have a function that takes in a pixel pointer in GLuint* form (shown below)

        bool Texture::loadTextureFromPixels32(GLuint* pixels, GLuint width, GLuint height)
        {
                freeTexture();

                mTextureWidth = width;
                mTextureHeight = height;

                glGenTextures(1, &mTextureID);

                glBindTexture(GL_TEXTURE_2D, mTextureID);

                glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);

                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

                glBindTexture(GL_TEXTURE_2D, NULL);

                GLenum error = glGetError();
                if(error != GL_NO_ERROR);
                {
                        printf("Error loading texture from %p. %s\n", pixels, gluErrorString(error));
                        return false;
                }

                return true;
        }
 

I have to cast image->getPixelsPtr() to GLuint* to get it to pass into that function but then opengl spits out an error saying it can't load that image.

Does anyone have any idea of what is going wrong?

Thanks in advance,
Dartos

2
General / Missing Functions in SFML Ubuntu
« on: March 04, 2012, 09:24:57 pm »
I tried to set up SFML with codeblocks in ubuntu. I tried 1.6 and 2 and the net result was everything pretty much working except for the fact that Renderwindow (and some other things) are missing functions.

The big one is the isOpen() function

any ideas.

Pages: [1]
anything