Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - smurf

Pages: 1 2 [3]
31
Graphics / Re: drawing a 1 pixel thick line
« on: February 02, 2021, 03:04:18 am »
I don't think so.
I don't see anywhere to set anti-aliasing in regards to these lines.

32
Graphics / drawing a 1 pixel thick line
« on: February 01, 2021, 08:10:20 pm »
How can I draw a simple 1-pixel thick line?
I've tried the obvious but it draws a 2-pixel thick line thats the wrong color! (I'm trying to draw it white but it comes out grey instead).

BTW I'm using the C# bindings if that matters.


Vertex[] line = new Vertex[2];
line[0].Position.X = 10;
line[0].Position.Y = 10;
line[0].Color.R = col.R;
line[0].Color.G = col.G;
line[0].Color.B = col.B;
line[0].Color.A = col.A;

line[1].Position.X = 10;
line[1].Position.Y = 100;
line[1].Color.R = col.R;
line[1].Color.G = col.G;
line[1].Color.B = col.B;
line[1].Color.A = col.A;

currentRenderTarget.Draw(line,0, 2, PrimitiveType.Lines);

33
Both of it's children, RenderWindow and RenderTexture have a display() function. Why not define it in the base class of RenderTarget?

Why do I care?

I want to re-use the same code for drawing to a window and drawing to a texture. So I want to be able to pass in the parent object (RenderTarget) into a drawing class that will just draw and not care about whether it is to a window or a texture.

But the lack of the display() function is preventing this.  What am I missing? This seems like an obvious thing to do.

Thanks,

Pages: 1 2 [3]