Advertisement

drawing triangle

Started by June 20, 2019 02:44 AM
24 comments, last by jbadams 5 years, 5 months ago
2 hours ago, phil67rpg said:

is there any good dx9  tutorials out there?

All written in Pascal unfortunately.

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

None in Modula-2 ?

 

*cough*

We live in 2019 (and it is half over). OpenGL is in version 4.6 (though that version lacks a little documentation), Vulkan is out since 3 years, D3D writes a 12. For those (like me) who shirk from the complexity of these APIs, OpenGL 4.5 and DX 11 have the functionality needed today. People still write tutorials for OpenGL 3.3, which i wouldn't touch with gloves any more now that we have bindless textures and buffers, support for threading like barriers and semaphores, ever more responsibility for resources is put into the shaders, memory bandwidth is the limited factor today, driver overhead is reduced.

If you're not into computer archeology or want to shine in talks about the good old times, learn D11 or OpenGL 4.5/4.6 (or D12/Vulkan if you're awesome).

Sorry for ranting ... ?

Edit: i am not on windows (linuxer), but doing a quick search on "D3D11 tutorial" results in enough material to keep one occupied.

Advertisement

All true...You too @fleabay. I understand. We used to say that DX9 still has relevance, considering the XBox360 but that time is also fading. This API version was interesting when it came to 'easy to use' mesh, animation and math utilities that were removed in later versions. For me, it was difficult to leave dx9 because of all the goodies that needed user rebuilt or designed in the newer versions. These guys do have a point that I agree with. Even in my current case, where I have not upgraded hardware since dx10 (this box just won't die) but I'm still creating a dx11 device while running within my feature set,, although I am limited to a <=Factory2 enumeration interface. 

I'm just not sure, that would be a good move for @phil67rpg or what his machine specs are. During that era when it was hot, there was http://rastertek.com who btw has a short [history mention] of the different versions. All well and good...

But the topic is changing vertex colors (in dx9) until phil say's different. 

Dev careful. Pixel on board.

But isn't that explained in detail in the tutorial ? I just glanced over it ...

There is a function init_graphics(void), just play with the colours there. Keep in mind, the pipeline interpolates between vertices. So, change the colours of two corners of the triangle and watch the world change ?

True again...What is your position Phil? Are you good now?

 

Dev careful. Pixel on board.

Just change the colour values in the function, it should work out, but the buffer is apparently static so far. It is a beginner's course. If you want to change colours between frames you need more logic. It'll probably come in up in a following tutorial. One step after the other.

 

Advertisement
5 hours ago, Green_Baron said:

There is a function init_graphics(void), just play with the colours there.

I have worked with this function but  it still does not work.

That's too meagre to get qualified help. What do you expect ?

The example from the tutorial draws the colours of the triangles in blue, green, red order, like depicted.

Your code example from the op, if it contains everything that you have changed to the original code (!), should draw the same triangle in red, blue, green order.

is that so ? Is that what you expect ? If not, what exactly do you expect ?

(Hint: leave the decrement operators out. Nothing will change, is suspect.)

I am trying to change the colors from black to color at runtime

Yup...Did you see the first answer at [ stack overflow ] . It's almost a copy / paste for you. 

Dev careful. Pixel on board.

This topic is closed to new replies.

Advertisement