Skip to content

Windows header compatibility problem (LogLevel ERROR) #98

Open
@Katharsas

Description

@Katharsas

Hi,

i am currently trying to migrate from ZenLib to ZenKit, but i have some problems with the headers. My renderer is DirectX only. It is also a bit chaotic with header includes (m basically including d3d headers everywhere so i can quickly implement things), like this:

#include <dxgi1_4.h>
#include <dxgi1_2.h>

#include <d3d11_1.h>
#include <d3d11.h>
#include <d3dx11.h>

#include <d3dx10.h>

(Yes im using both modern DX as well as old DX SDK, but problem is the same when only using modern DX.)

However, d3d headers include some windows headers like wingdi.h. This cannot be changed without fully removing d3d headers. They depend on constants/macros in wingdi.h so i cannot use NOGDI preprocessor flag.

wingdi.h has the following line:
#define ERROR 0

This conflicts with ZenKit's logging in Logger.h:

namespace zenkit {
	enum class LogLevel : std::uint8_t {
		ERROR = 0,

So basically this is my fault for not having very clean separation between asset loading and direct3d code. However maybe you would be willing to change the ERROR value (g3log for example uses FATAL) so ZenKit can be used easily with windows-heavy code?

If not i can understand that.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions