Zenipex

The Zenilib Start Guide


Index

  1. Setup the Development Environment
  2. Download Zenilib
  3. Extract Zenilib
  4. OpenAL SDK Issues
  5. Open and Build Zenilib

Instructions

Setup

Set up the Development Environment if you haven't already.

Download Zenilib

Download the latest versions of zenilib and its supporting files.

At the time of this writing:
zenilib_0.3.2.1.7z
zenilib_0.3.2.0_support.7z (for Visual Studio 2008, x86/x64)
zenilib_0.3.2.0_frameworks.zip (for Xcode 3.1.2)

Note that the supporting files version number sometimes lags behind the current version number of zenilib.

Note that I offer no supporting files for Linux. apt-get should be used instead. See step 1.

Extract Zenilib

Ensure that there is not already a directory 'zenilib/' on the Desktop.
Then extract both archives to the desktop.

If you are targeting the Win32 architecture, zenilib/ should contain a list of files resembling the following:

Note the absence of a 'zenilib/' directory within zenilib/.

In MacOS X, include_win/ and lib_win/ can be absent. You must move (or copy) the 'Frameworks/' directory into zenilib/.

Missing the OpenAL SDK?

Can't Install it? This might be the case if you are using a CAEN Windows installation. Simply download and extract these additional supporting files.

If you are working on a computer with the OpenAL SDK installed correctly, you should absolutely skip this step.

If you prefer, the steps to disable OpenAL are described in 'zenilib/Visual Studio 2008/README.txt'.

Open and Build Zenilib

  1. In Windows, open 'zenilib/Visual Studio 2008/Zenilib_2008.sln'.
    In MacOS X, open 'zenilib/Xcode 3.1.2/Zenilib.xcodeproj'.
    In Linux, run 'scons' to build or 'scons --help' for options, and skim the rest of this guide.

  2. Switch from the 'Debug SCU' build target to the 'Debug ZeniSCU' build target, and make sure that you are #including <zenilib.h> at the top of each of your CPP files. (If you don't #include <zenilib.h>, you will get compilation errors due to the use of precompiled headers. You may switch back to 'Debug SCU' if you prefer.)

    Switching from 'Debug SCU' to 'Debug ZeniSCU'

    This disables the Single Compilation Unit pattern for your code. If you wish to experiment with the SCU build targets for yourself, be sure to

    • Keep an up-to-date list of your source files in 'SCU File/application.cxx'.
    • Exclude your source files from the build for SCU build targets.

  3. It may be a good idea to let Intellisense finish indexing your project.

  4. In Visual Studio, hit 'Ctrl-Shift-B' to build the solution.
    In Xcode, hit 'Apple-B' to build the solution.
    In Linux, run 'scons' to build the solution.

    The Visual Studio build log should read something like:
    1>------ Build started: Project: Zenilib, Configuration: Debug SCU Win32 ------
    1>Compiling...
    1>zenilib.cxx
    1>Creating library...
    1>Build log was saved at "file://c:\Users\username\Desktop\zenilib\Visual Studio 2008\Win32\zenilib_d\Zenilib_BuildLog.html"
    1>Zenilib - 0 error(s), 0 warning(s)
    2>------ Build started: Project: Application, Configuration: Debug SCU Win32 ------
    2>Compiling...
    2>application.cxx
    2>Compiling manifest to resources...
    2>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    2>Copyright (C) Microsoft Corporation.  All rights reserved.
    2>Linking...
    2>   Creating library Win32\Application_d\Application.lib and object Win32\Application_d\Application.exp
    2>Embedding manifest...
    2>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    2>Copyright (C) Microsoft Corporation.  All rights reserved.
    2>Generate Application_Name.h
    2>Copy the build to 'zenilib\bin'.
    2>        1 file(s) copied.
    2>Build log was saved at "file://c:\Users\username\Desktop\zenilib\Visual Studio 2008\Win32\Application_d\Application_BuildLog.html"
    2>Application - 0 error(s), 0 warning(s)
    3>------ Build started: Project: Launcher, Configuration: Debug Win32 ------
    3>Compiling...
    3>Launcher.cpp
    3>Compiling manifest to resources...
    3>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    3>Copyright (C) Microsoft Corporation.  All rights reserved.
    3>Linking...
    3>Embedding manifest...
    3>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    3>Copyright (C) Microsoft Corporation.  All rights reserved.
    3>Copy the build to 'zenilib'.
    3>        1 file(s) copied.
    3>Build log was saved at "file://c:\Users\username\Desktop\zenilib\Visual Studio 2008\Win32\Launcher_d\BuildLog.htm"
    3>Launcher - 0 error(s), 0 warning(s)
    ========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
    
    Note the emphasis on the build targets and on the final line of output.

    Also note that no launcher is needed in MacOS X or in Linux.

    If you have problems here, it is probably because you did not correctly Setup the Development Environment and are either missing SDKs or Visual Studio path settings for those SDKs.

  5. In Visual Studio, hit 'Ctrl-F5' to run Application_d.exe. (Or hit 'F5 to debug Application.exe.)
    In Xcode, hit 'Apple-R' to run Application_d. (Or hit 'Apple-Y' to debug Application_d.)
    In Linux, simply run './application_d' or './application_x64d'. (Or run 'ddd ./application*' to open a debugger, and type 'run' to debug.)

    You should see an 800x600 window appear (unless you have already customized rendering settings). It will check that rendering options are acceptable before displaying a title screen. You can exit with 'Ctrl-Alt-F4' or by clicking the close button on the window frame.

    If the window does not open and 'stderr.txt' logs something to the effect of 'Zeni Video Failed to Initialize Correctly', you can try changing the API being used:

    1. Open 'zenilib/config/zenilib.xml'.
    2. Change the line reading '<API>OpenGL</API>' to read '<API>DX9</API>'.

    Switching rendering engines can be useful for debugging other graphical issues as well.

    Note that as of 0.3.1.0, another copy of zenilib.xml is stored in a user-specific directory and that the user-specific copy is given strict priority over the copy stored with the project.