Jump to content

[c++] Texture coloring in a buffer


Skrakle
 Share

Recommended Posts

I'm using a buffer to draw a minimap along with a dot representing my position. The dot is a normal texture that i'm loading, 1x1 white image and when i draw it on the buffer, i want to set its color like in context->SetColor but it stays white. Is there some way to obtain the context of a buffer?

 

      	 Buffer* buf = Buffer::Create(minimap_width, minimap_height);
           buf->Enable();
           buf->Clear();

      	 buf->SetColor(1, 1, 0, 1);  // does not set color like context->SetColor does

      	 //minimap->Draw(0, 0);
      	 //buf->SetColorTexture(minimap);
      	 dot->Draw(pos.x, pos.y, 5, 5);    // resizing my dot 5x5
      	 buf->SetColorTexture(dot);

           buf->Disable();

           m_rendertarget = buf->GetColorTexture();  // dump the buffer into a texture
           buf->Release();

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...