HGE1.81 all IDE's, DirectX 8, DirectX 9, Shaders - Git repo
  • kvakvskvakvs September 2011
    Hello, everyone

    I've spent few hours today reconfiguring the original HGE 1.8.1 to compile and link properly on (hopefully) most Windows IDEs. This was done using CMake build system.


    THIS IS BOTH DirectX 8 and DirectX 9 version in the same source tree.
    Shaders are supported if you build for DirectX 9


    GIT repository
    https://github.com/kvakvs/hge
    Example platformer Game - GIT repo
    https://github.com/kvakvs/hge_skel



    Results:
    * All HGE libraries build properly (HGE, HGE-Static, HGEHelpers, ZLIB, libPNG)
    ** if you link against hge library, you only need to mention HGE.LIB in project settings, and have HGE.DLL in your program folder. HGEHELPERS is not needed (its linked internally).
    ** if you link against hge-static flavour of library, you don't need HGE.DLL anymore, all functionality remains ok. You need to mention HGEHELPERS, ZLIB and HGELIBPNG in linker settings of your project for this to work.
    * All HGE tools build properly (fontconv, fonted, particleed, pngopt, texasm). Tools were tested briefly and seem to be starting correctly.
    * All 8 HGE examples build properly, all tested and working.
    * Binaries updated in tools/ and tutorials/precompiled directories.
    * BASS works properly (BASS DLL was not updated).

    Current release #1 contains BAT files to produce projects for Visual Studio 2005, 2008 and 2010, but since CMake supports much many more platforms (codeblocks, eclipse, mingw/msys/borland makefiles etc) you can just run CMake (inside cmake/bin directory) without parameters and see what other targets it supports and create your own BAT file - i will add those BAT files in next release, as soon as I get news about successful compiling on those IDEs.

    NOTE: Other platforms will compile properly ONLY if you have compiler version recent enough (of year 2005+).
    NOTE: You still need 230+ megabytes of DirectX8 SDK from microsoft website (may require windows genuinity check). DirectX directory should be configured in CMakeLists.txt (see HGE_CMake_README.txt)
    NOTE: For DirectX9 you can get some more fresh DirectX 9 SDK (around year 2010 or so will do, ~550MB download from Microsoft.com)

    Parts of CMake 2.8 are packaged inside the archive, its license is attached, and it allows redistribution.
  • DaiShivaDaiShiva September 2011
    nice!
  • kvakvskvakvs September 2011
    If anyone downloaded this and attempted compiling/linking with your game, please post your success/failure here, i will use this info to improve and upload fixed release.
  • UnknownUnknown September 2011
    Please upload it somewhere else, my download stops allways at 905kb~
  • kvakvskvakvs September 2011
    added main link from my server, and dropbox remains as a backup
  • UnknownUnknown September 2011
    hmm maybe its a problem with my current internet connection.
    i have to wait till tomorrow , then i'll test it again.

    But thanks for your help, i'll give feedback.
  • UnknownUnknown September 2011
    Ok i've tested it, it works fine for me (win 7, 2010c++ express).

    The only thing i had to change was in the linker settings (and including the dx9 SDK), i had to change from Dx9 x64 to Dx9 x86.

    Great work !
  • kvakvskvakvs September 2011
    Did you change all files, copied from DX9 project over my files?
    Maybe its a good idea to prepare DX9 flavour of my distribution and test it myself.
  • UnknownUnknown September 2011
    If you like i can upload the changed .cpp's an .h's with dx9, the only thing you have to change then is ne linker option to dx9
  • kvakvskvakvs September 2011
    I have created GIT repository for holding the files.
    I took the DX9 patched version from here: http://relishgames.com/forum/viewtopic.php?t=4842&start=60 - posted by Ciziu
    Now will have to think how to make this source build from the same source tree as the original DX8 version. Maybe some configuration file switch, or some BAT file to switch between DX8 and DX9 builds.

    Stay tuned to the GIT repo.
    https://github.com/kvakvs/hge

    Keeping the original sources as unchanged as possible for now (except one define in hge.h and include paths for ZLIB and LIBPNG), just tuning the build and configuration files :) Who knows maybe this project gains a new life.

    P.S. Uploaded separate dx8 and dx9 sources, switching with single line in main CMakeLists.txt, dx9 is not compiling properly yet. Keeping sources separate as much as possible for now, will see if it can be properly merged into a single source tree switchable by C++ preprocessor definitions. Almost sure it is possible yes. https://github.com/kvakvs/hge/tree/master/src
  • kvakvskvakvs September 2011
    Merged DX8 and DX9 code into a single codebase, see in GIT repo.
    Merged with Daishiva's shader patch, the shader code and shader tutorial will be compiled if you change to DirectX 9 (set by default).

    Now DirectX SDK is selected by 2 options in main CMakeLists.txt:
    1
    2
    3
    SET( DIRECTX_SDK_DIR "C:/DXSDK" )
    ##--- set this to 8 or 9 ---
    SET( HGE_DIRECTX_VER "9" )

    Rest is autoconfigured, required DirectX libraries selected automatically in generated project.
    See https://github.com/kvakvs/hge/blob/master/include/hge_gapi.h
  • kvakvskvakvs September 2011
    New plan is to make it support Unicode.
    Unicode is work-in-progress atm, in the branch "unicode", there's branch selection listbox in menu bar, if you wish to see how it goes.
  • UnknownUnknown September 2011
    Works fine for me (windows 7)

    Thanks !
  • kvakvskvakvs September 2011
    Unknown said:

    Works fine for me (windows 7)

    Thanks !


    Hope you got latest version from github using GIT (it can then be updated from main repository when i change things and commit).



    Regarding the Unicode version.

    Managed to finish editing all the string constants and stuff in Unicode mode, they are using wchar_t, but I'm still temptative to rework it for UTF8 which is more compact and faster.

    All tutorials compile and work fine with unicode enabled now. Got rid of fontconv and fonted tools, I will suggest using BMFont now. What's left to do - add in unicode font support and test that every tool works fine. If anyone wishes to see how it goes, download or check out from GIT the "unicode" branch in source tree.
  • UnknownUnknown October 2011
    http://relishgames.com/forum/viewtopic.php?t=2305

    Maybe u can add this to the public version too.
  • kvakvskvakvs October 2011
    Yes just thought of that hour ago.
    But it uses D3D9 code to detect support, might have to rewrite it to support both DX8 and DX9 or disable the hack in DX8 version. So this needs some reading & testing, will do it in the evening today.

    P.S. Pushed changes for master branch, should compile with D3D8 and D3D9 support, demos seem to be working.
  • kvakvskvakvs October 2011
    regarding the Unicode branch
    'unicode' is an experimental branch in HGE GIT repo, this is not the master branch. Master is in good condition.

    I'm thinking to give up on 'unicode' patch, too many changes too many risks to break some code, and too high chance it won't work on an existing project without massive editing.

    I've got an idea to fork HGE and start a new one, sort of HGE C++ project which will be based on C++, STL, and be Unicode compatible. But won't maintain 100% backwards API compatibility. That will untie my hands to do something reasonably good, which will still look like HGE, walk like HGE, quack like HGE, but won't be HGE :)
  • uprizeuprize November 2011
    Love this, will check it out for sure.



    Unknown said:

    [url]http://relishgames.com/forum/viewtopic.php?t=2305[/url]

    Maybe u can add this to the public version too.



    Has this been added to the latest source?




    kvakvs said:

    regarding the [b]Unicode branch[/b]
    [color=red]'unicode' is an experimental branch in HGE GIT repo[/color], this is not the master branch. Master is in good condition.

    I'm thinking to give up on 'unicode' patch, too many changes too many risks to break some code, and too high chance it won't work on an existing project without massive editing.

    I've got an idea to fork HGE and start a new one, sort of HGE C++ project which will be based on C++, STL, and be Unicode compatible. But won't maintain 100% backwards API compatibility. That will untie my hands to do something reasonably good, which will still [url=http://en.wikipedia.org/wiki/Duck_typing]look like HGE, walk like HGE, quack like HGE, but won't be HGE[/url] :)



    This sounds even better! How long until something like this will be completed?
    It would be good if you did it for DX9 only. It is nearly 2012, I dont think any machines run dx8 anymore?
    If you are taking ideas requests, I would also love if you added TTF font support :D

    P.S This new forum layout sucks :/
  • kvakvskvakvs November 2011
    The hardware vertex support had been added to master branch on github some weeks ago.

    Unicode version is in "sort-of-working" state without fonts at the moment, there were so many changes required to do it. I am totally unsure at the moment if it was worth the trouble doing it, and if its worth to continue working on that -- it goes too far away from the original HGE idea and codebase.

    There's an already-existing HGE clone called HGEUE, its listed on forum and at http://hge.longcat.info

    And regarding the hgepp clone, which I referred to, it may have some future, but again can't guarantee any finish times, its not announced here as being a useable project, as of yet.

    uprize said:

    P.S This new forum layout sucks :/


    Well there's 2 ways to see forums: main page which is same as the old forum, and "Discussions" which is sorted from newest to oldest, with pinned topics floating on top. I think its much easier now to get newest posts and monitor forum activity than it was in old phpbb2.
  • morzmorz December 2011
    Nice work!

    But I have some trouble while build your project on VS 2008 SP1.

    File stdint.h is not included by Microsoft in VS by default. Only version of VS that include this file is VS 2010.

    Proof: http://stackoverflow.com/questions/126279/c99-stdint-h-header-and-ms-visual-studio

    So it is impossible to build your project in VS other than 2010.

    P.S.: I have downloaded stdint.h and add it to project. Now all works but stdint.h is conflicted with boost cstdint.hpp :)
  • kvakvskvakvs December 2011
    stdint is basically giving few numeric types like int32_t, uint32_t, and byte_t (uint8_t), you could define them using C types (int, unsigned int, unsigned char) or using Microsoft specific types (__int32, unsigned __int32, unsigned __int8) and remove stdint.
    Or include boost's stdint and redefine types using boost::int32_t, and other types.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    // in HGE.H
    typedef int int32_t;
    typedef unsigned int uint32_t;
    typedef unsigned char int8_t;
    typedef unsigned char byte_t;
     
    typedef uint32_t HTEXTURE;
    typedef uint32_t HTARGET;
    typedef uint32_t HEFFECT;
    typedef uint32_t HMUSIC;
    typedef uint32_t HSTREAM;
    typedef uint32_t HCHANNEL;
    #if HGE_DIRECTX_VER >= 9
    typedef uint32_t HSHADER;
    #endif


    My fault, I will post an issue to tracker, and fix that someday soon. Probably will rename types to hge::something to get rid of name-clash with boost and stdint.
  • morzmorz December 2011
    I knew purpose of stdint :)

    Rename some types for hge is good idea. Also, why you replace DWORD to uint32_t?
  • kvakvskvakvs December 2011
    morz said:

    I knew purpose of stdint :)

    Rename some types for hge is good idea. Also, why you replace DWORD to uint32_t?


    DWORD is a Windows-specific type and is exactly a 32-bit unsigned int.
    One step towards unification between platforms :) Not really needed for a pure Win32-only engine, but its like a good habit which I could not resist.

    I pushed edited version yesterday, renamed globally across all sources all int*_t types to hgeU32, hgeS32, hgeU16, hgeS16, hgeU8, hgeS8.
    https://github.com/kvakvs/hge/blob/master/include/hge.h Lines 49-64
  • AzureBlazeAzureBlaze January 2012
    There's a bug in Z Buffer that I ran into today and was about to mention it for the third time:
    http://relishgames.com/forum/index.php?p=/discussion/5569/zwrite-bug/p1
    http://relishgames.com/forum/index.php?p=/discussion/4033/hge-zbuffer-bug./p1

    Maybe you'd like to fix this in the repo?
  • kvakvskvakvs January 2012
    Pushed to https://github.com/kvakvs/hge
    According to solution in topic 4033 by NobleQiao
  • SantalLicanSantalLican April 2012
    A bug in hgeskel executable example ! ("...hgeskel\bin\HGESKEL.exe")
    ("Unhandled exception at 0x00401005 in HGESKEL.exe : 0xC0000005
    Access violation reading location 0x00000080")
    Message by Visual Studio 2008


  • kvakvskvakvs April 2012
    Be more detailed, where did it crash? File and Line of code?
  • DANTEDANTE May 2012
    The version of HGE stays at 1.81 for a long time.Is it going to be upgraded recently or in the future not far?
  • kvakvskvakvs May 2012
    The original author is not working on the project.
    In my GIT repository I collected all notable updates and patches, shaders, DirectX9 support, but the engine version is still 1.81.
  • UhfgoodUhfgood September 2012
    to download this version I need to go and click on every file in the repo? Or is there a zip file with everything in it?
  • AzureBlazeAzureBlaze September 2012
    Download as zip is between "clone in windows" and "http" in top of the page
  • UhfgoodUhfgood September 2012
    Thanks -- Okay everything is compiling and setup correctly, although when i tried to test out the tutorials the windows kept closing on everything after tutorial 1. Then I found out by reading the log that bass wasn't present, then when I ran tutorial 2, it couldn't find some of the data files, so i'm wondering if I need to get the original hge distribution to get those data files and what not?
  • kvakvskvakvs September 2012
    See 'examples' directory with precompiled EXE files for each demo, they contain everything to run demos, I have tested each one before committing and pushing to github. If you copy files from those folders, or of you move your experimental EXE TO those folders, it should run.
  • UhfgoodUhfgood September 2012
    Actually it's apparently under kvakvs-hge-a72c82b/tutorials/precompiled -- "examples" folder isn't there.
  • UhfgoodUhfgood September 2012
    I have bizarre things happening. If I play with select demos, (2, 5 - non shader version, 6 -- just at the beginning) in the folder where the exe's are located (the ones I compiled with msvc++ 2010 express) it really plays with my screen, shuddering and jittering. And it's not just the graphics in the programs but the whole screen. The example 5 shader version has no problem. Then when I go into msvc express, everything seems to work fine without screwing with the screen but the shader app doesn't do anything when you hit 1,2,3, or 4 --

    I'm running an hp laptop with windows 7 home (64bit) -- and intel integrated graphics. (gma 4500 -- I think, can't remember for sure exactly). I've got the july 2010 direct-x sdk. and am running direct-x 10 here...

    So there may be some issues with those.
  • UhfgoodUhfgood September 2012
    Okay apparently it's not doing it now, so it must be something to do with my system somehow, maybe my new laptop battery. the shader thing still stands though. I can run the tutorial directly in the folder it was compiled in (tutorial 5 shader version) and I can get it to change with the numbers, however if I run it in the ide (msvs 2010 express) I can't get the shader options to do anything.
  • kvakvskvakvs September 2012
    Not sure how battery is related to shaders. But for sure older Intel and S3 onboard graphic chips did play lot of tricks for me in past. Might be a chance you will have to debug your shaders or add some code to avoid intel-specific quirks?
  • DahamugoDahamugo October 2012
    I'm having some problems with the DirectX 9 version.
    I'm able to compile the DirectX 8 version just fine (using the SDK from http://www.microsoft.com/en-us/download/details.aspx?id=21416) and it works like a charm.

    However, going through the exact same process for the Directx 9 version, hge compiles fine and seems to work at first, but when trying to call hge->Texture_Load (which works just fine with the DirectX 8 version), I get the following error:

    Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

    Since I'm going through the same compilation process that worked for DirectX 8, I can only assume that it's a DirectX related problem. Unfortunately I have no experience developing with DirectX, so I don't really know where to look.
    I'm using Visual Studio 10 and the DirectX SDK from http://www.microsoft.com/en-us/download/details.aspx?id=6812

    I don't even know what I'm missing out on by not using DX9, so for now I can just continue development with the the DX8 version, but it would be nice to get this issue sorted out nonetheless.
  • kvakvskvakvs October 2012
    The ESP and all those suspicious errors are not related to HGE or DirectX. Most likely your program on startup found an old version of HGE.DLL and used it instead, not the one you just compiled.
  • DahamugoDahamugo October 2012
    I took extra care to ensure that the game was loading the hge.dll generated by the directX 9 version. I can double check that again once I get access to my computer, but I'm pretty confident that is not the case.
  • kvakvskvakvs October 2012
    You can try and contact me directly, I would use remote desktop like teamviewer.com, to see your screen and see why its failing. But in 2 hours i'll be leaving for the day, and will pop online for short time around midnight central-european time, then next morning at work. http://longcat.info/index.php/kv
  • DahamugoDahamugo October 2012
    Thanks for the support. I won't be able to arrange that within the next 2 hours, but I might be able to at midnight central-european time. If not, I'll try contatcting you at a later time.
    Meanwhile I'll continue to try and figure it out by myself.
  • DahamugoDahamugo October 2012
    I also just remembered that at a point when trying to figure out this problem, I tried using hge's static library with the DirectX 9 version. Though the library compiled fine, when trying to build a project using hge I got some linker errors to functions that might have been Dx ones (because of stress and tiredness I didn't pay much attention).
    In any case, since I don't have access to my own computer at the moment I can't check that just yet, but it might be something worth taking note of.
  • DahamugoDahamugo October 2012
    When trying to compile a project with the hge-static.lib built from the DX9 version I get the following errors:

    1>hge-static.lib(system.obj) : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "public: virtual bool __stdcall HGE_Impl::System_Initiate(void)" (?System_Initiate@HGE_Impl@@UAG_NXZ)
    1>hge-static.lib(random.obj) : error LNK2001: unresolved external symbol __imp__timeGetTime@0
    1>hge-static.lib(system.obj) : error LNK2019: unresolved external symbol __imp__timeBeginPeriod@4 referenced in function "public: virtual bool __stdcall HGE_Impl::System_Initiate(void)" (?System_Initiate@HGE_Impl@@UAG_NXZ)
    1>hge-static.lib(system.obj) : error LNK2019: unresolved external symbol __imp__timeEndPeriod@4 referenced in function "public: virtual void __stdcall HGE_Impl::System_Shutdown(void)" (?System_Shutdown@HGE_Impl@@UAGXXZ)
    1>hge-static.lib(system.obj) : error LNK2019: unresolved external symbol _D3DXSaveSurfaceToFileA@20 referenced in function "public: virtual void __stdcall HGE_Impl::System_Snapshot(char const *)" (?System_Snapshot@HGE_Impl@@UAGXPBD@Z)
    1>hge-static.lib(graphics.obj) : error LNK2019: unresolved external symbol _D3DXMatrixOrthoOffCenterLH@28 referenced in function "public: virtual void __stdcall HGE_Impl::Gfx_SetClipping(int,int,int,int)" (?Gfx_SetClipping@HGE_Impl@@UAGXHHHH@Z)
    1>hge-static.lib(graphics.obj) : error LNK2019: unresolved external symbol _D3DXMatrixMultiply@12 referenced in function "public: virtual void __stdcall HGE_Impl::Gfx_SetClipping(int,int,int,int)" (?Gfx_SetClipping@HGE_Impl@@UAGXHHHH@Z)
    1>hge-static.lib(graphics.obj) : error LNK2019: unresolved external symbol _D3DXMatrixTranslation@16 referenced in function "public: virtual void __stdcall HGE_Impl::Gfx_SetClipping(int,int,int,int)" (?Gfx_SetClipping@HGE_Impl@@UAGXHHHH@Z)
    1>hge-static.lib(graphics.obj) : error LNK2019: unresolved external symbol _D3DXMatrixScaling@16 referenced in function "public: virtual void __stdcall HGE_Impl::Gfx_SetClipping(int,int,int,int)" (?Gfx_SetClipping@HGE_Impl@@UAGXHHHH@Z)
    1>hge-static.lib(graphics.obj) : error LNK2019: unresolved external symbol _D3DXMatrixRotationZ@8 referenced in function "public: virtual void __stdcall HGE_Impl::Gfx_SetTransform(float,float,float,float,float,float,float)" (?Gfx_SetTransform@HGE_Impl@@UAGXMMMMMMM@Z)
    1>hge-static.lib(graphics.obj) : error LNK2019: unresolved external symbol _D3DXCreateTexture@32 referenced in function "public: virtual unsigned int __stdcall HGE_Impl::Target_Create(int,int,bool)" (?Target_Create@HGE_Impl@@UAGIHH_N@Z)
    1>hge-static.lib(graphics.obj) : error LNK2019: unresolved external symbol _D3DXCreateTextureFromFileInMemoryEx@60 referenced in function "public: virtual unsigned int __stdcall HGE_Impl::Texture_Load(char const *,unsigned int,bool)" (?Texture_Load@HGE_Impl@@UAGIPBDI_N@Z)
    1>hge-static.lib(graphics.obj) : error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function "public: bool __thiscall HGE_Impl::_GfxInit(void)" (?_GfxInit@HGE_Impl@@QAE_NXZ)
    1>hge-static.lib(graphics.obj) : error LNK2019: unresolved external symbol _D3DXCompileShaderFromFileA@36 referenced in function "public: virtual unsigned int __stdcall HGE_Impl::Shader_Create(char const *)" (?Shader_Create@HGE_Impl@@UAGIPBD@Z)


    Although, I also get a similar list of errors with the DX8 version of hge-static, except it mentions the symbol _Direct3DCreate8@4 instead of _Direct3DCreate9@4, and the last error (error LNK2019: unresolved external symbol _D3DXCompileShaderFromFileA@36 referenced in function "public: virtual unsigned int __stdcall HGE_Impl::Shader_Create(char const *)" (?Shader_Create@HGE_Impl@@UAGIPBD@Z)) isn't present at all.
    Even if this is not related to the problem I'm having, it's still an issue of its own.
  • kvakvskvakvs October 2012
    "unresolved external symbol __imp__timeGetTime@0"
    Add winmm to list of libraries you are linking to.
    "unresolved external symbol _D3DX"
    Add d3dx* (there might be two of them d3dx and d3dx9) library to the list of libs.
    et cetera.

    When you link statically, you don't get all libs automatically linked to DLL, you have to list all of them manually. You can open CMakelists or HGE.DLL project and see list of libs you have to link against.
  • ProfEclipseProfEclipse October 2012
    Those errors can be avoided in Visual Studio by including #pragma directives to include them. E.g.:
    #pragma comment(lib,"winmm.lib")
    #pragma comment(lib,"d3dx.lib")
    etc.

    Compilers that understand those pragmas will honor them. Compilers that don't will safely ignore them.

    If you put those pragmas in one of the .CPP files (such as system.cpp), then the linker will automatically include them.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

In this Discussion

Who's Online (2)