-
|
Can you explain typedef struct platform_api ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Yes, this is basically an interface for working with the platform layer. I did want to try experimenting with solving these in a platform independent way. Those are all function pointers where a platform specific implementation will actually implement them. That way the platform independent knows that it can just call that function pointer and it will dispatch to the proper function as implemented in the platform specific code. That struct is where you can basically declare and define what you need from the platform layer. |
Beta Was this translation helpful? Give feedback.
Yes, this is basically an interface for working with the platform layer. I did want to try experimenting with solving these in a platform independent way.
Those are all function pointers where a platform specific implementation will actually implement them. That way the platform independent knows that it can just call that function pointer and it will dispatch to the proper function as implemented in the platform specific code.
That struct is where you can basically declare and define what you need from the platform layer.