Jump to content

  • Log In with Google      Sign In   
  • Create Account

wqking

Member Since 29 Jul 2010
Offline Last Active Mar 31 2014 04:51 AM

Posts I've Made

In Topic: How to allow file create/read/write/modify access in Program Files for a patcher

24 October 2013 - 08:32 PM

You can install your core app to "program files" folder, which will not be updated.

Then your core app installs updatable app/resources to a writable folder.

Your "core app" only does two jobs:

1, Check auto update

2, Execute your main app from the writable folder.

 

This is how we did auto update in mobile games. Hope it helps.


In Topic: Will there ever be another language of the web?

15 August 2013 - 09:27 PM

I hope in the future JavaScript becomes the "binary machine code" of the internet, similar as the real binary machine code on local machine. Then we use higher level and better language, then the language is compiled to JavaScript. Similar as we compile C++ to binary code.

Seems this is the trend. Microsoft has already had TypeScript.


In Topic: Different output lib file based on #define

15 August 2013 - 08:00 PM

Then the project that uses your engine has to define the macro in build configuration, or define the macro before include any headers in your engine. There is no better choice, IMHO.

 

There are two approaches to possible improve this,

1, Auto detect which DX version to use, if there is any version related macro in DX headers, maybe you can use it? I'm not sure if it's possible because I never used DX.

2, Change the headers in your engine DX agnostic. Thus your engine only exposes one single interface to the users. This is better API design and how a lot of cross platform open source projects do.


In Topic: Help with Dependency Injection Scenario

15 August 2013 - 03:21 AM

When not add a "context" parameter to Draw?

class RenderContext
{
public:
HWND getWindowHandle() const;
};

struct IRenderer
{
     pure virtual void Draw(const RenderContext & context) =0;
};

And on each render, CDesktopWindow creates a RenderContext (or reuse a cached one) and pass it to IRenderer.

 

EDIT:

I just reallized you need window handle to intialize DX. So passing the handle to Draw may not solve your problem. Then maybe you can add an "intialize" to IRenderer.

struct IRenderer
{
    virtual void Initialize(HWND windowHandle) = 0;
     pure virtual void Draw() =0;
};


In Topic: Different output lib file based on #define

14 August 2013 - 07:57 PM

If you use seperate build configuration, it's fine to put the macros in build configuration (C++->Preprocessor) because you don't need to change the macros any more.

 

Your current approach, single build configuration, to make for DX9, define API_DX9 in build configuration, to make for DX11, change API_DX9 to API_DX11, whole project will be recompiled.

 

The seperate build configuration approach. You have two build configuration. config9 and config11. In config9, you define API_DX9 in build configuration, in config11, you define API_DX11. Now to build different target, you just select different build configuration, no need to change the macro, so only part of the project will be recompiled.


PARTNERS