Copyright 2008-2012 Michel Pollet <buserror@gmail.com>
- This file is part of simavr.
+ This file is part of libc3.
- simavr is free software: you can redistribute it and/or modify
+ libc3 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
- simavr is distributed in the hope that it will be useful,
+ libc3 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with simavr. If not, see <http://www.gnu.org/licenses/>.
+ along with libc3. If not, see <http://www.gnu.org/licenses/>.
*/
#include "c3camera.h"
enum {
- C3_CONTEXT_VIEW_EYE = 0,
+ C3_CONTEXT_VIEW_NONE = 0,
+ C3_CONTEXT_VIEW_EYE,
C3_CONTEXT_VIEW_LIGHT
};
typedef struct c3context_view_t {
- int type : 4, // C3_CONTEXT_VIEW_EYE...
- dirty : 1;
- c3vec2 size; // in pixels. for fbo/textures/window
+ int type : 4, // C3_CONTEXT_VIEW_EYE...
+ dirty : 1,
+ index : 4; // index in context array
+ c3apiobject_t bid; // buffer id (fbo, texture...)
+ c3vec2 size; // in pixels. for fbo/textures/window
c3cam_t cam;
+ c3mat4 projection; // projection matrix
c3geometry_array_t projected;
struct {
* This is a wrapper around a "top level object", the list of projected
* geometries is kept, purged and resorted if the root object becomes
* dirty
- * TODO: Add the camera/eye/arcball control there
*/
typedef struct c3context_t {
int current;
c3context_p c);
//! Reproject geometry for dirty objects
-void
+int
c3context_project(
c3context_p c);
//! Draws the context
c->current = view;
}
-
#endif /* __C3CONTEXT_H___ */