dbsoft / dwindows

Dynamic Windows Library Mirror
Other
8 stars 1 forks source link

More abstraction is needed #19

Closed ghost closed 1 year ago

ghost commented 1 year ago

Discussed in https://github.com/dbsoft/dwindows/discussions/17

Originally posted by **iahung2** September 22, 2023 Take IUP library as a reference: https://sourceforge.net/projects/iup/files/3.30/Windows%20Libraries/Dynamic/ You can't see any platform specific macros on the headers. Everything is abstracted nicely. `dw.h` instead is a gigantic header with full of platform specific macros. The constants and structs are also varied on each platforms (e.g: GTK vs Win32).
dbsoft commented 1 year ago

Well, part of the idea originally anyway was it is a native interface... so you should be able to access platform specifics if you want to.... but at the same time be able to write code that can run on any supported platform.

I could have chosen to abstract everything with opaque types so you couldn't accidentally do something you shouldn't, but I wanted to give the developers to do things natively if the library didn't provide that support in a platform specific #ifdef

Sorry for the delay in responding I was out of town the past week and wasn't keeping up on GitHub activity.