Does anyone know how to draw a rectangle on screen? I'm thinking of adding the a dynamic bar, similar to what iRacing does. I tried with Direct3D DrawPrimitive() and a TriangleStrip, but I have no idea where I'm drawing in the 3D space. What I want is just painting a rectangle in "sort of 2D mode".
I think I'll start looking at this article about sprites with Direct3D: http://www.toymaker.info/Games/html/sprites.html About v8, I think it's the best version yet. Upcoming changes: much more accurate delta timing, using high speed telemetry (every 0.01 s) updates in-between the scoring updates (every 0.2 s) much better visual display of delta time changes. Counter now accelerates more or less depending on the difference. Not easy to explain, but works similarly to the iRacing delta time counter. Counter updates feel much smoother now. fixed bug that kept the best lap reference across different tracks/cars/sessions. Now best lap is reset every time you start a new session. I prefer this behaviour for now, even if it's not ideal, to having a completely wrong reference time that was recorded on a different track. I'm still trying to implement the colored bar, but v8 overall is already better IMHO. Will release something tonight (in 4-5 hours I think).
Here's a preview video of version 8 (still marked as in-development, "v8-dev"): (still uploading as of now, check back in an hour or so) I won't spoil the surprise... check out the video Not released yet, as you can see there's a few minor glitches. I'll see if I can iron them out before releasing v8. Of course, if you have strong opinions, let me know. I also want to thank everyone for the fantastic positive feedback and especially want to thank the ones of you who donated. It's not required, and I don't need financial support, but it's nice to know there's people who appreciate this work For full disclosure: I usually buy books out of contributions like these
Great v8 Cosimo, could you please provide me the code snippet you have used to draw the grey rectangle? Thanks in advance.
Great work. Before watch the last video I donĀ“t understand (with words) the use of the bar, now is perfectly clear.
Hi Gerald, have a look at the article about Direct3D Sprites I posted above: http://www.toymaker.info/Games/html/sprites.html and, full source code to the plugin is also available on my github account: https://github.com/cosimo/rFactor2-DeltaBest/blob/master/Source/DeltaBest.cpp#L516
Maybe I should have explained. I made a simple 1024x64 white texture (DeltaBestBackground.png). By using Sprite->Draw() it's possible to draw several rectangles with different color masks. The code at this point is a pile of junk and I have no idea if this is sane or not. It's my first venture into DirectX...
Released version 8, codename "Indy" Updated first post and explanatory video. This is the first release that implements the dynamic color bar like iRacing does. It's still less refined visually, but the functionality is (I believe) the same. Enjoy!
+1 for ''just the number'', is the bar needed? It is a great work, but is possible to have a v8 ''bar edition'' and another v8 ''no bar edition''? thx!
thanks for the v8! its getting better with every version maybe you can add 2 options to the ini file: 1. bar on / off 2. edit option for key shortcut to toggle the plug in, would be nice to change it.
Indeed if you want to go fast in relation to laptimes it is a lot easier to figure out if your gained or lost time by interpreating a bar than numbers? It is more important to easily see if you lost/gained time than knowing how much it acually was. So let the bar where it is or even change the sides (right side gaining time/negative values; left side loosing time/positive values)
Implemented now in version 9, via the Enabled=0/1 attributes in the INI file. It is possible to enable or disable either the colored bar or the text. Check the first post!