-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransitioning.tex
More file actions
171 lines (136 loc) · 6.97 KB
/
Transitioning.tex
File metadata and controls
171 lines (136 loc) · 6.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
% -*- latex -*-
\chapter{Transitioning from \IceT 1.0 to \IceT 2}
\label{chap:Transitioning}
In the transition from \IceT version 1 to \IceT version 2, one of the major
goals was to make the core \IceT library independent of \OpenGL. All of
\IceT's abilities to interface with \OpenGL are retained but isolated in a
separate library.
This change and others necessitated changes in the \IceT interface. This
chapter provides simple instructions for transitioning existing code to the
new \IceT interface.
\section{Header File Changes}
\label{sec:Transitioning:Header_File_Changes}
Because previous versions of \IceT were considered an \OpenGL library,
public header files were placed in a \textC{GL} subdirectory. Previous
code included \index{ice-t.h}\index{GL/ice-t.h}\textC{GL/ice-t.h} and often
also included
\index{ice-t\_mpi.h}\index{GL/ice-t\_mpi.h}\textC{GL/ice-t\_mpi.h}.
\begin{code}
#include <GL/ice-t.h>
#include <GL/ice-t_mpi.h>
\end{code}
These header files no longer exist. The header files are now no longer in
the \textC{GL} directory and have changed in case and spelling to
\index{IceT.h}\textC{IceT.h} and \index{IceTMPI.h}\textC{IceTMPI.h}. There
is also a new header file called \index{IceTGL.h}\textC{IceTGL.h} that
contains the specific \OpenGL functionality. A straight transition to
\IceT~2 will require this header file as well.
\begin{code}
#include <IceT.h>
#include <IceTGL.h>
#include <IceTMPI.h>
\end{code}
\section{Basic Type Changes}
\label{sec:Transitioning:Basic_Type_Changes}
\IceT~1 used the basic types defined by \OpenGL such as
\index{GLint}\textC{GLint} and \index{GLfloat}\textC{GLfloat}. \IceT now
defines its own basic types such as \index{IceTInt}\textC{IceTInt} and
\index{IceTFloat}\textC{IceTFloat}, and these new types should be used in
place of the \OpenGL types with respect to data passed to and from \IceT.
\section{Function Name Changes}
\label{sec:Transitioning:Function_Name_Changes}
To make the \OpenGL layer explicit, all functions in this layer are prefixed
with \textC{icetGL}. This along with some other minor implementation
details require slight changes in existing code.
First, before any other \textC{icetGL} functions are called,
\CFunc{icetGLInitialize} must be called. \CFunc{icetGLInitialize} should
be called right after the context is created:
\begin{code}
icetCreateContext(comm);
icetGLInitialize();
\end{code}
Make certain to call \CFunc{icetGLInitialize} for \emph{each} context for
which you use the \OpenGL layer.
Apart from adding a function call for \CFunc{icetGLInitialize}, there are
only two function names that have changed:
\index{icetDrawFunc}\textCF{icetDrawFunc} and \CFunc{icetDrawFrame} have
changed to \CFunc{icetGLDrawCallback} and \CFunc{icetGLDrawFrame},
respectively.
Technically, a function called \CFunc{icetDrawFrame} still exists, but its
interface has changed (so you should get a compiler error if you try to use
it) and its behavior now skips any \OpenGL specific operations (specifically
reading and adjusting \OpenGL state).
The function \index{icetInputOutputBuffers}\textCF{icetInputOutputBuffers}
has also been removed. It has been replaced with the two functions
\CFunc{icetSetColorFormat} and \CFunc{icetSetDepthFormat}, which basically
set the input buffers. The output buffers are implicitly set to be the
same as the input buffers, but if the \CEnum{ICET\_COMPOSITE\_ONE\_BUFFER}
feature is enabled, then the depth buffer will be suppressed in the output
if both the color and depth buffer are read as input. This is the only
sensible case for the input and output buffers to differ.
There is also a new function named \CFunc{icetCompositeMode} to explicitly
set the composite operation (z-buffer or blending). Previous versions of
\IceT implicitly set the composite mode based on what type of image data
was available. To ensure that \IceT is behaving as the user expects, this
is now set explicitly. You will get errors if you have picked a composite
mode that cannot be implemented with the image data available.
\section{Getting Image Data}
\label{sec:Transitioning:Getting_Image_Data}
The \index{icetGetColorBuffer}\textCF{icetGetColorBuffer} and
\index{icetGetDepthBuffer}\textCF{icetGetDepthBuffer} functions no longer
exist. The underlying data storage for images has become more flexible,
and this method of getting image data became insufficient.
Instead, \CFunc{icetGLDrawFrame} now returns an \CType{IceTImage} object.
There is a suite of new functions available, described in
Chapter~\ref{sec:Basic_Usage:Image_Objects}, that allow you to get data
from \CType{IceTImage} objects. The methods that get color and data
information from image objects are \icetImageGetColorub and
\icetImageGetDepthf, respectively.
Also note that \IceT now uses floating point numbers for depth values.
Previous versions of \IceT used 32-bit integers. Although using these
integers was fast, \IceT had problems with identifying background pixels.
Different graphics hardware used different values for the maximum depths.
However, the \OpenGL specification places the maximum depth value at $1.0$
if using floating point values.
\section{Miscellaneous Changes}
\label{sec:Transitioning:Miscellaneous}
The serial strategy has been renamed to the sequential strategy. This
better reflects the actual operation of the strategy as image compositing
is still performed in parallel. As such, the
\CEnum{ICET\_STRATEGY\_SERIAL} identifier has changed to
\CEnum{ICET\_STRATEGY\_SEQUENTIAL}.
\section{Libraries}
\label{sec:Transitioning:Libraries}
The names of the libraries have changed from \index{icet (library)}icet and
\index{icet\_mpi (library)}icet\_mpi to \index{IceTCore (library)}IceTCore
and \index{IceTMPI (library)}IceTMPI, respectively. Additionally, there is
also an \index{IceTGL (library)}IceTGL library that contains code for the
\OpenGL layer. The \index{icet\_strategies (library)}icet\_strategies
library no longer exists. Everything in this library has been merged into
IceTCore.
\section{CMake Configuration}
\label{sec:Transitioning:CMake_Configuration}
The \index{CMake}CMake configuration for CMake has changed a bit between
CMake version 1 and 2. You no longer need a copy of
\index{FindIceT.cmake}FindIceT.cmake. The \textC{FIND\_PACKAGE(IceT)}
still works, but relies only on the
\index{IceTConfig.cmake}IceTConfig.cmake file generated by \IceT.
The use file prevously defined in \CEnum{ICET\_USE\_FILE} no longer exists.
Instead, you will need to insert your own commands to specify the \IceT
header and library locations.
There is a new variable called \CEnum{ICET\_GL\_LIBS} that specifies the
libraries used for the \OpenGL layer. The variables
\CEnum{ICET\_CORE\_LIBS} and \CEnum{ICET\_MPI\_LIBS} still exist to specify
the core and MPI layer libraries, respectively.
Here is some typical CMake script fragment for using \IceT.
\begin{code}
FIND_PACKAGE(IceT REQUIRED)
INCLUDE_DIRECTORIES(${ICET_INCLUDE_DIRS})
ADD_EXECUTABLE(myprog ${SRCS})
TARGET_LINK_LIBRARIES(myproc
${ICET_CORE_LIBS}
${ICET_GL_LIBS}
${ICET_MPI_LIBS}
)
\end{code}
%$