internal static unsafe GLTexture CreateBG(GLContext ctx) { GLTexture tex = new GLTexture(ctx, 16, 16); tex.Bind(); //Create BG texture ABGRPixel left = new ABGRPixel(255, 192, 192, 192); ABGRPixel right = new ABGRPixel(255, 240, 240, 240); int * pixelData = stackalloc int[16 * 16]; ABGRPixel *p = (ABGRPixel *)pixelData; for (int y = 0; y < 16; y++) { for (int x = 0; x < 16; x++) { *p++ = ((x & 8) == (y & 8)) ? left : right; } } //ctx.glEnable(GLEnableCap.Texture2D); //ctx.glBindTexture(GLTextureTarget.Texture2D, _backTex._id); ctx.glTexParameter(GLTextureTarget.Texture2D, GLTextureParameter.WrapS, (int)GLTextureWrapMode.REPEAT); ctx.glTexParameter(GLTextureTarget.Texture2D, GLTextureParameter.WrapT, (int)GLTextureWrapMode.REPEAT); ctx.glTexParameter(GLTextureTarget.Texture2D, GLTextureParameter.MinFilter, (int)GLTextureMinFilter.NEAREST); ctx.glTexParameter(GLTextureTarget.Texture2D, GLTextureParameter.MagFilter, (int)GLTextureMagFilter.NEAREST); ctx.glTexImage2D(GLTexImageTarget.Texture2D, 0, GLInternalPixelFormat._4, 16, 16, 0, GLPixelDataFormat.RGBA, GLPixelDataType.UNSIGNED_BYTE, pixelData); return(tex); }
public CLR0Entry(CLR0EntryFlags flags, ABGRPixel mask, ABGRPixel color) { _stringOffset = 0; _flags = (uint)flags; _colorMask = mask; _data._data = *(int *)&color; }
public bint _data; //Could be offset or color! Offset from itself public CLR0Entry(CLR0EntryFlags flags, ABGRPixel mask, int offset) { _stringOffset = 0; _flags = (uint)flags; _colorMask = mask; _data = offset; }
public CLR0MaterialEntry(ABGRPixel mask, int offset) { _colorMask = mask; _data = offset; }
public CLR0MaterialEntry(ABGRPixel mask, ABGRPixel color) { _colorMask = mask; _data._data = *(int *)&color; }
public CLR0Material(CLR0EntryFlags flags, ABGRPixel mask, ABGRPixel color) { _stringOffset = 0; _flags = (uint)flags; }