4
* A Low Level GPU Graphics and Utilities API
6
* Copyright (C) 2008,2009,2010 Intel Corporation.
8
* Permission is hereby granted, free of charge, to any person
9
* obtaining a copy of this software and associated documentation
10
* files (the "Software"), to deal in the Software without
11
* restriction, including without limitation the rights to use, copy,
12
* modify, merge, publish, distribute, sublicense, and/or sell copies
13
* of the Software, and to permit persons to whom the Software is
14
* furnished to do so, subject to the following conditions:
16
* The above copyright notice and this permission notice shall be
17
* included in all copies or substantial portions of the Software.
19
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
* Neil Roberts <neil@linux.intel.com>
38
#include "cogl-context-private.h"
39
#include "cogl-util-gl-private.h"
40
#include "cogl-pipeline-private.h"
41
#include "cogl-pipeline-state-private.h"
42
#include "cogl-pipeline-opengl-private.h"
43
#include "cogl-framebuffer-private.h"
45
#ifdef COGL_PIPELINE_VERTEND_FIXED
47
#include "cogl-context-private.h"
48
#include "cogl-object-private.h"
49
#include "cogl-program-private.h"
51
const CoglPipelineVertend _cogl_pipeline_fixed_vertend;
54
_cogl_pipeline_vertend_fixed_start (CoglPipeline *pipeline,
56
unsigned long pipelines_difference)
58
_cogl_use_vertex_program (0, COGL_PIPELINE_PROGRAM_TYPE_FIXED);
62
_cogl_pipeline_vertend_fixed_add_layer (CoglPipeline *pipeline,
63
CoglPipelineLayer *layer,
64
unsigned long layers_difference,
65
CoglFramebuffer *framebuffer)
67
CoglContext *ctx = framebuffer->context;
68
int unit_index = _cogl_pipeline_layer_get_unit_index (layer);
69
CoglTextureUnit *unit = _cogl_get_texture_unit (unit_index);
71
if (layers_difference & COGL_PIPELINE_LAYER_STATE_USER_MATRIX)
73
CoglPipelineLayerState state = COGL_PIPELINE_LAYER_STATE_USER_MATRIX;
74
CoglPipelineLayer *authority =
75
_cogl_pipeline_layer_get_authority (layer, state);
76
CoglMatrixEntry *matrix_entry;
78
cogl_matrix_stack_set (unit->matrix_stack,
79
&authority->big_state->matrix);
81
_cogl_set_active_texture_unit (unit_index);
83
matrix_entry = unit->matrix_stack->last_entry;
84
_cogl_matrix_entry_flush_to_gl_builtins (ctx, matrix_entry,
87
FALSE /* enable flip */);
94
_cogl_pipeline_vertend_fixed_end (CoglPipeline *pipeline,
95
unsigned long pipelines_difference)
97
_COGL_GET_CONTEXT (ctx, FALSE);
99
if (pipelines_difference & COGL_PIPELINE_STATE_POINT_SIZE)
101
CoglPipeline *authority =
102
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_POINT_SIZE);
104
if (authority->big_state->point_size > 0.0f)
105
GE( ctx, glPointSize (authority->big_state->point_size) );
111
const CoglPipelineVertend _cogl_pipeline_fixed_vertend =
113
_cogl_pipeline_vertend_fixed_start,
114
_cogl_pipeline_vertend_fixed_add_layer,
115
_cogl_pipeline_vertend_fixed_end,
116
NULL, /* pipeline_change_notify */
117
NULL /* layer_change_notify */
120
#endif /* COGL_PIPELINE_VERTEND_FIXED */