Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int totalTextureWidth, totalTextureHeight;
- //2 Pixel Buffer between all subtextures
- totalTextureWidth = d_colourPickerPickingTextureWidth + 2 + d_colourPickerSliderTextureWidth;
- totalTextureHeight = d_colourPickerPickingTextureHeight;
- RGB_Colour* colourPickingTexture = new RGB_Colour[totalTextureWidth * totalTextureHeight];
- for(int y = 0; y < totalTextureHeight; ++y)
- {
- for(int x = 0; x < totalTextureWidth; ++x)
- {
- int index = totalTextureWidth * y + x;
- CEGUI::Logger::getSingleton().logEvent(PropertyHelper::intToString(index));
- colourPickingTexture[index] = RGB_Colour(std::min(x/(float)(totalTextureWidth-1)*255, 255.f),0,0);
- }
- }
- //Border
- //for(int y = 0; y < d_colourPickerPickingTextureHeight; ++y)
- // colourPickingTexture[d_colourPickerPickingTextureWidth * y + d_colourPickerPickingTextureWidth] = colourPickingTexture[(d_colourPickerPickingTextureWidth - 1) * y + d_colourPickerPickingTextureWidth];
- d_colourPickerControlsTextureTarget->getTexture().loadFromMemory(colourPickingTexture, CEGUI::Size((float)totalTextureWidth, (float)totalTextureHeight), Texture::PF_RGB);
- delete colourPickingTexture;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement