Author Topic: Drawing graphics primitives in Windows and Linux  (Read 10049 times)

Offline debs3759

  • Global Moderator
  • Full Member
  • *****
  • Posts: 224
  • Country: gb
    • GPUZoo
Drawing graphics primitives in Windows and Linux
« on: June 18, 2020, 08:54:08 PM »
Some 25 years ago, I wrote some simple windowing code for DOS, which could create a main window and thousands of child windows. It was very fast on a 486DX33, even when testing switching between hundreds of child windows.

Just for fun, I am now going back to the original code and planning to rewrite using nasm. The 16-bit DOS (or OS independant, using int 10) will be easy. I also want to write a version that works in Windows and Linux (both 32-bit only for now, as I have yet to jump into learning 64-bit code). The hardest part will be drawing pixels and lines. To do this in Windows and/or Linux, both of which are new to me, do I need to learn OpenGL programming, or is there an easier option for either of them?
My graphics card database: www.gpuzoo.com

Offline clockworkd

  • Jr. Member
  • *
  • Posts: 10
Re: Drawing graphics primitives in Windows and Linux
« Reply #1 on: September 03, 2020, 06:03:35 AM »
Hullo debs,
I know this is an old topic but it said you were active today so I thought I’d reply... you’re right, OpenGL would be overkill.
I would use Simple Direct Media Layer (libsdl) if I was you.

https://www.libsdl.org/

There is a helper library here for drawing primitives:

https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/

I use it on my MacBook. I think you may need to compile it yourself though unfortunately.

Offline debs3759

  • Global Moderator
  • Full Member
  • *****
  • Posts: 224
  • Country: gb
    • GPUZoo
Re: Drawing graphics primitives in Windows and Linux
« Reply #2 on: September 03, 2020, 10:57:02 AM »
Thank you. I will look at those links later. I have no problem compiling the code, and if I like it I will use it as the base for rewriting in nasm.
My graphics card database: www.gpuzoo.com