• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling OTClient with DX9 / EGL Support - Investigation thread

Lord Hepipud

PhiadariaSoft
Joined
Sep 1, 2009
Messages
198
Reaction score
22
Location
Germany
Hello everyone,

as I'm trying to build the OTClient with DX9 / EGL Support to allow the uage of DirectX on Windows Systems I want to start this thread here allowing everyone else who is willing to assist with this for getting it to work.

As for DirectX, there is dead code inside the OTClient (DIRECTX Compiler Flag) which will no longer work. As for the support of DirectX, we will have tu use the ANGLE project from google.

ANGLE project: https://code.google.com/p/angleproject/

I have already installed all required tools, mentioned at this tutorial link:
https://code.google.com/p/angleproject/wiki/DevSetup

What I've got:

Libs (Debug / Release of x86/x64):
* libANGLE.lib
* libEGL.lib
* libGLESv2.lib
* preprocessor.lib
* translator.lib
* translator_lib.lib
* translator_static.lib

Dlls (Debug / Release of x86/x64):
* d3dcompiler_47.dll
* libEGL.dll
* libGLESv2.dll


In my OTClient project I have included the following source directories:
* Angle

Inside this directory the source files and folders for angle are inside
* EGL
* GLES2
* GLES3
* GLSLANG
* KHR
* angle_gl.h
* angle_windowsstore.h

I have added the following comiler flag:
* OPENGL_ES=2

From the lib side, I have currently included the following regarding the angle project:
* libEGL.lib
* libGLESv2.lib

I'm trying to compile:
* OTClient Release x86 (32-Bit)

When I hit recompile entire project on VS 2013, everything works fine. The Client is build successfully and I can start it. After trying to start it, he pushs a correct warning that libEGL.dll is missing.
Placing it into the client folder, it prompts me that libGLESv2.dll is missing as well. Copying that into the folder, tell me that EGL could not be initialised.

So after finally putting d3dcompiler_47.dll into the directory, the client tries to start. It does however crash with the following crsashreport:

Code:
== application crashed
app name: Phiadaria Beta Client
app version: 1.0.9
build compiler: msvc12
build date: Dec  9 2014
build type: Release
build revision: 0 (PhiadariaSoft)
crash date: Dec 09 2014 08:50:30
exception: Integer divide by zero (0xc0000094)
exception address: 0x00ab86fa
  backtrace:
    0: D:\Games\Phiadaria Beta\PhiadariaClient.exe(BitmapFont::load+0x5ba) [0x0000000000AB86FA]
    1: D:\Games\Phiadaria Beta\PhiadariaClient.exe(FontManager::importFont+0x2f5) [0x0000000000ABB195]
    2: D:\Games\Phiadaria Beta\PhiadariaClient.exe(std::_Callable_obj<<lambda_f7db3b97b18e37c0a431d539ac33bbef>,0>::_ApplyX<bool,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &>+0x7c) [0x0000000000A5E06C]
    3: D:\Games\Phiadaria Beta\PhiadariaClient.exe(<lambda_818a45b46eed649c88320bc671295e44>::operator()+0x128) [0x0000000000A00768]
    4: D:\Games\Phiadaria Beta\PhiadariaClient.exe(std::_Func_impl<std::_Callable_obj<<lambda_818a45b46eed649c88320bc671295e44>,0>,std::allocator<std::_Func_class<int,LuaInterface *> >,int,LuaInterface *>::_Do_call+0x10) [0x0000000000A32330]
    5: D:\Games\Phiadaria Beta\PhiadariaClient.exe(LuaInterface::luaCppFunctionCallback+0x6b) [0x0000000000ACAFBB]
    6: D:\Games\Phiadaria Beta\luajit.dll [0x000000005022266F]
    7: D:\Games\Phiadaria Beta\luajit.dll(lua_pcall+0x56) [0x0000000050227236]
    8: D:\Games\Phiadaria Beta\PhiadariaClient.exe(Module::load+0x375) [0x0000000000AAE575]
    9: D:\Games\Phiadaria Beta\PhiadariaClient.exe(Module::load+0x549) [0x0000000000AAE749]
    10: D:\Games\Phiadaria Beta\PhiadariaClient.exe(ModuleManager::ensureModuleLoaded+0x68) [0x0000000000AB0B08]
    11: D:\Games\Phiadaria Beta\PhiadariaClient.exe(<lambda_900ed0a580071e10fef6cffb96c7e7b5>::operator()+0x126) [0x0000000000A008D6]
    12: D:\Games\Phiadaria Beta\PhiadariaClient.exe(std::_Func_impl<std::_Callable_obj<<lambda_900ed0a580071e10fef6cffb96c7e7b5>,0>,std::allocator<std::_Func_class<int,LuaInterface *> >,int,LuaInterface *>::_Do_call+0x10) [0x0000000000A32500]
    13: D:\Games\Phiadaria Beta\PhiadariaClient.exe(LuaInterface::luaCppFunctionCallback+0x6b) [0x0000000000ACAFBB]
    14: D:\Games\Phiadaria Beta\luajit.dll [0x000000005022266F]
    15: D:\Games\Phiadaria Beta\luajit.dll(lua_error+0x2497) [0x0000000050245387]
    16: D:\Games\Phiadaria Beta\luajit.dll(lua_pcall+0x56) [0x0000000050227236]
    17: D:\Games\Phiadaria Beta\PhiadariaClient.exe(LuaInterface::safeRunScript+0x48) [0x0000000000AC9A78]
    18: D:\Games\Phiadaria Beta\PhiadariaClient.exe(main+0x29a) [0x0000000000B980BA]
    19: D:\Games\Phiadaria Beta\PhiadariaClient.exe(__tmainCRTStartup+0xfd) [0x0000000000BD29C2]
    20: C:\Windows\SYSTEM32\KERNEL32.DLL(BaseThreadInitThunk+0x24) [0x0000000075677C04]
    21: C:\Windows\SYSTEM32\ntdll.dll(RtlInitializeExceptionChain+0x8f) [0x00000000771BB90F]
    22: C:\Windows\SYSTEM32\ntdll.dll(RtlInitializeExceptionChain+0x5a) [0x00000000771BB8DA]


Does anyone got this to work with Visual Studio? Is there anyone else who can give me a short idea what went wrong? It looks like the Client works proplery frm compiler side, but that something is still missing.

Lets find this out and write detailed tutorial!

Thank you in advance!

~~~~Lord Hepipud~~~~
 
Played around now a little and the client is crashing during startup at function

Code:
void BitmapFont::load(const OTMLNodePtr& fontNode)

at

Code:
// calculate glyphs texture coords
    int numHorizontalGlyphs = m_texture->getSize().width() / glyphSize.width();

for(int glyph = m_firstGlyph; glyph < 256; ++glyph) {
        m_glyphsTextureCoords[glyph].setRect(((glyph - m_firstGlyph) % numHorizontalGlyphs) * glyphSize.width(),
                                                ((glyph - m_firstGlyph) / numHorizontalGlyphs) * glyphSize.height(),
                                                m_glyphsSize[glyph].width(),
                                                m_glyphHeight);
    }

The value numHorizontalGlyphs is 0. Thats why the client is crasing. Looks like an issue with OpenGL?

~~~~Lord Hepipud~~~~
 
Back
Top