To draw something with a Batch one has to first call the {@link Batch#begin()} method which will setup appropriate renderstates. When you are done with drawing you have to call {@link Batch#end()} which will actually draw the things you specified.
All drawing commands of the Batch operate in screen coordinates. The screen coordinate system has an x-axis pointing to the right, an y-axis pointing upwards and the origin is in the lower left corner of the screen. You can also provide your own transformation and projection matrices if you so wish.
A Batch is managed. In case the OpenGL context is lost all OpenGL resources a Batch uses internally get invalidated. A context is lost when a user switches to another application or receives an incoming call on Android. A Batch will be automatically reloaded after the OpenGL context is restored.
A Batch is a pretty heavy object so you should only ever have one in your program.
A Batch works with OpenGL ES 1.x and 2.0. In the case of a 2.0 context it will use its own custom shader to draw all provided sprites. You can set your own custom shader via {@link #setShader(ShaderProgram)}.
A Batch has to be disposed if it is no longer used. @author mzechner @author Nathan Sweet
Batch
contains an ordered list of Step
s.
@author VIGUIER
Batch
defines an ordered list of of operations that must be executed at once on the persistent layer. If any of the modifications added to the batch fails, none of the other changes must be persisted, thus leaving the persistent layer unaffected. The Batch
object is obtained by calling {@link RepositoryService#createBatch(SessionInfo,ItemId)}. The following methods can then be called on the returned Batch
object to queue the corresponding operations: Batch
is aborted and an exception is thrown. The Batch mechanism is required because there are sets of operations for which the following are both true: Batch
mechanism is desirable in order to minimize calls to the persistent layer, which enables client-server implementations to reduce the number of network roundtrips. Since the batch records the delta of pending changes within the scope of an {@link javax.jcr.Item#save()} (or a {@link javax.jcr.Session#save()} it isintended to be constructed upon save (not before) and then submitted to the persistent layer as a single logical operation (see above). Note however, that methods of the JCR API that have immediate effect on the persistent storage have to call that storage, validate and return. The batch does not play a role in these operations, instead they are covered by the {@link RepositoryService}.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|