Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.16 KB | None | 0 0
  1.     int totalTextureWidth, totalTextureHeight;
  2.         //2 Pixel Buffer between all subtextures
  3.         totalTextureWidth = d_colourPickerPickingTextureWidth + 2 + d_colourPickerSliderTextureWidth;
  4.         totalTextureHeight = d_colourPickerPickingTextureHeight;
  5.  
  6.         RGB_Colour* colourPickingTexture = new RGB_Colour[totalTextureWidth * totalTextureHeight];
  7.  
  8.  
  9.         for(int y = 0; y < totalTextureHeight; ++y)
  10.         {
  11.             for(int x = 0; x < totalTextureWidth; ++x)
  12.             {
  13.                 int index = totalTextureWidth * y + x;
  14.                 CEGUI::Logger::getSingleton().logEvent(PropertyHelper::intToString(index));
  15.                 colourPickingTexture[index] = RGB_Colour(std::min(x/(float)(totalTextureWidth-1)*255, 255.f),0,0);
  16.             }
  17.         }
  18.  
  19.         //Border
  20.         //for(int y = 0; y < d_colourPickerPickingTextureHeight; ++y)
  21.         //  colourPickingTexture[d_colourPickerPickingTextureWidth * y + d_colourPickerPickingTextureWidth] = colourPickingTexture[(d_colourPickerPickingTextureWidth - 1) * y + d_colourPickerPickingTextureWidth];
  22.  
  23.         d_colourPickerControlsTextureTarget->getTexture().loadFromMemory(colourPickingTexture, CEGUI::Size((float)totalTextureWidth, (float)totalTextureHeight), Texture::PF_RGB);
  24.         delete colourPickingTexture;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement