Back to Content

Windows (.exe) Target

When creating Windows .exe applications with CopperCube, there are some special features available:

Command Line Arguments

The single created .exe file offers some command line arguments when starting it:


The following command line will start your application in windowed mode:
yourapplication.exe -windowed
The following will use a the script file 'myscript.js' instead of the compiled script and show the debugging console if some line of text is printed in your script. This is useful for example for developing the script file without the CopperCube editor.
yourapplication.exe -debug -script:myscript.js

Scripting with JavaScript

You can make your CopperCube 3D Windows .exe scenes more interactive using a built-in scripting language named 'JavaScript'. See the scripting overview for a detailed description how to use this feature.

Additionally on this target, you can use a separate script file to develop your scripts.
If you want to use this feature, do the following steps:


Write this text in your .js file:
print("Hello World!");
When testing your 3D scene from the CopperCube editor, this will print the text 'Hello World' into the debug console.
CopperCube also provides a menu command so you can test if the syntax of your script is ok, use the Menu Command Tools -> Compile Main Script for this.

Development tip:

If you prefer to develop your script without the CopperCube Editor running, you can do this using the -debug and the -script: command line arguments. See Command Line Arguments for details.

Reference and Examples

Using an icon

In the publishing settings, you can select an icon for your Windows app. Note that embedding the icon in your app might slow down the publishing process by a few seconds, depending on your operating system. Also, some versions of Windows occasionally cause an error during this process, and you will get an "internal error" reported when you start testing your app from time to time. So during development, it is better not to select an icon.
Also note that this feature is not supported in the Mac OS X version of CopperCube.

Steam Support

Windows .exe apps created by CopperCube support Valve's Steam and have a built-in Steam integration.

In order to test it and develop your game with it, do the following: You can then use the JavaScript functions ccbSteamSetAchievement and ccbSteamResetAchievements in order to set and reset steam achievements.

Windows Modes

Two window modes are supported: The "Exclusive / Fixed Size" window mode with a fixed size window and exclusive resolution in fullscreen mode, and a newer window mode which is known as "borderless windowed" or "dynamic / resizeable" mode. You can set which window mode you want in the publishing settings.
The default one, the "dynamic / resizeable" mode has a few advantages: This mode is usually used by most modern games.

Making sure it runs on your users systems

Usually, .exe files generated by CopperCube run on all systems, but sometimes, they don't have DirectX installed. This will cause some shaders not to work and your game not to look that nice on the users PC. To ensure DirectX is installed on your users system, CopperCube has a very simple mechanism included in the .exe, which installs DirectX on your users system when it is not there. To enable this, follow these steps:
Your game folder now should look like this:

If your CopperCube game now detects that DirectX is not installed, it will show the user a message box like this:
"This app needs DirectX to be installed. Install now?".
You can also change the text of this message box easily: In the 'dxredist' folder, create a text file named 'message.txt'. In there, type the message you would like to print instead.

Source Code

If you want to extend the app with very specific custom features, you can do this by compiling the App yourself and programming your own additions. You can get the source code if you own the Studio Edition of CopperCube: In the editor, click Help -> About, and then the "Download C++ Source" button.
The code is a VisualStudio 2005 Project. It is based on the open source Irrlicht 3D engine and should be fairly easily to extend. A short documentation on how to build the package can be found in the root named documentation.txt. The code also includes the parts for the Oculus Rift support, but it is not supported (beta) and you likely need to adjust it to newer Oculus Rift SDKS.