Esempio n. 1
0
        public CubeMapTexture(String texturePath, CubeMapType type)
        {
            if (!texturePath.EndsWith("/"))
                texturePath += "/";

            this.type = type;
            textures = new int[1];
            Gl.glGenTextures(1, textures);
            Gl.glBindTexture(Gl.GL_TEXTURE_CUBE_MAP, textures[0]);

            Gl.glTexParameteri(Gl.GL_TEXTURE_CUBE_MAP, Gl.GL_TEXTURE_MAG_FILTER, Gl.GL_LINEAR);
            Gl.glTexParameteri(Gl.GL_TEXTURE_CUBE_MAP, Gl.GL_TEXTURE_MIN_FILTER, Gl.GL_LINEAR_MIPMAP_LINEAR);
            Gl.glTexParameteri(Gl.GL_TEXTURE_CUBE_MAP, Gl.GL_TEXTURE_WRAP_S, Gl.GL_CLAMP_TO_EDGE);
            Gl.glTexParameteri(Gl.GL_TEXTURE_CUBE_MAP, Gl.GL_TEXTURE_WRAP_T, Gl.GL_CLAMP_TO_EDGE);
            Gl.glTexParameteri(Gl.GL_TEXTURE_CUBE_MAP, Gl.GL_TEXTURE_WRAP_R, Gl.GL_CLAMP_TO_EDGE);

            Pixmap pixmap;

            for(int i = 0; i < 6; i++)
            {
                // Load this texture map
                Gl.glTexParameteri(Gl.GL_TEXTURE_CUBE_MAP, Gl.GL_GENERATE_MIPMAP, Gl.GL_TRUE);
                pixmap = new Pixmap(texturePath + path[i] + ".bmp");
                Gl.glTexImage2D(cube[i], 0, pixmap.Bpp, pixmap.Width, pixmap.Height, 0, pixmap.getFormat(), Gl.GL_UNSIGNED_BYTE, pixmap.Data);
            }
        }
Esempio n. 2
0
        public BasicTexture(Pixmap pixmap, TextureFilter textureFilter)
        {
            int[] TempGL = new int[1];

            Gl.glGenTextures(1, TempGL);
            Gl.glBindTexture(Gl.GL_TEXTURE_2D, TempGL[0]);

            Glu.gluBuild2DMipmaps(Gl.GL_TEXTURE_2D, pixmap.Bpp, pixmap.Width, pixmap.Height, pixmap.getFormat(), Gl.GL_UNSIGNED_BYTE, pixmap.Data);

            textureID = TempGL[0];
            this.textureFilter = textureFilter;
            width = pixmap.Width;
            height = pixmap.Height;
        }
Esempio n. 3
0
        public BasicTexture(Pixmap pixmap, TextureFilter textureFilter)
        {
            int[] TempGL = new int[1];

            Gl.glGenTextures(1, TempGL);
            Gl.glBindTexture(Gl.GL_TEXTURE_2D, TempGL[0]);

            Glu.gluBuild2DMipmaps(Gl.GL_TEXTURE_2D, pixmap.Bpp, pixmap.Width, pixmap.Height, pixmap.getFormat(), Gl.GL_UNSIGNED_BYTE, pixmap.Data);

            textureID          = TempGL[0];
            this.textureFilter = textureFilter;
            width  = pixmap.Width;
            height = pixmap.Height;
        }
Esempio n. 4
0
        public CubeMapTexture(String texturePath, CubeMapType type)
        {
            if (!texturePath.EndsWith("/"))
            {
                texturePath += "/";
            }

            this.type = type;
            textures  = new int[1];
            Gl.glGenTextures(1, textures);
            Gl.glBindTexture(Gl.GL_TEXTURE_CUBE_MAP, textures[0]);

            Gl.glTexParameteri(Gl.GL_TEXTURE_CUBE_MAP, Gl.GL_TEXTURE_MAG_FILTER, Gl.GL_LINEAR);
            Gl.glTexParameteri(Gl.GL_TEXTURE_CUBE_MAP, Gl.GL_TEXTURE_MIN_FILTER, Gl.GL_LINEAR_MIPMAP_LINEAR);
            Gl.glTexParameteri(Gl.GL_TEXTURE_CUBE_MAP, Gl.GL_TEXTURE_WRAP_S, Gl.GL_CLAMP_TO_EDGE);
            Gl.glTexParameteri(Gl.GL_TEXTURE_CUBE_MAP, Gl.GL_TEXTURE_WRAP_T, Gl.GL_CLAMP_TO_EDGE);
            Gl.glTexParameteri(Gl.GL_TEXTURE_CUBE_MAP, Gl.GL_TEXTURE_WRAP_R, Gl.GL_CLAMP_TO_EDGE);

            Pixmap pixmap;

            for (int i = 0; i < 6; i++)
            {
                // Load this texture map
                Gl.glTexParameteri(Gl.GL_TEXTURE_CUBE_MAP, Gl.GL_GENERATE_MIPMAP, Gl.GL_TRUE);
                pixmap = new Pixmap(texturePath + path[i] + ".bmp");
                Gl.glTexImage2D(cube[i], 0, pixmap.Bpp, pixmap.Width, pixmap.Height, 0, pixmap.getFormat(), Gl.GL_UNSIGNED_BYTE, pixmap.Data);
            }
        }