mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-29 05:08:00 +03:00
34 lines
704 B
C++
34 lines
704 B
C++
![]() |
#include "DirectDraw.hpp"
|
||
|
|
||
|
#include <glrage/GLRage.hpp>
|
||
|
#include <glrage_util/ErrorUtils.hpp>
|
||
|
#include <glrage_util/Logger.hpp>
|
||
|
|
||
|
#include <string>
|
||
|
|
||
|
namespace glrage {
|
||
|
namespace ddraw {
|
||
|
|
||
|
HRESULT WINAPI DirectDrawCreate(
|
||
|
GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnknown FAR* pUnkOuter)
|
||
|
{
|
||
|
LOG_TRACE("%p, %p, %p", lpGUID, lplpDD, pUnkOuter);
|
||
|
|
||
|
Context& context = GLRage::getContext();
|
||
|
context.init();
|
||
|
context.attach();
|
||
|
|
||
|
ErrorUtils::setHWnd(context.getHWnd());
|
||
|
|
||
|
try {
|
||
|
*lplpDD = new DirectDraw();
|
||
|
} catch (const std::exception& ex) {
|
||
|
ErrorUtils::warning(ex);
|
||
|
return DDERR_GENERIC;
|
||
|
}
|
||
|
|
||
|
return DD_OK;
|
||
|
}
|
||
|
|
||
|
} // namespace ddraw
|
||
|
} // namespace glrage
|