Changeset 758
- Timestamp:
- Apr 28, 2011, 9:01:37 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/monsterz/board.cpp
r752 r758 20 20 #include "core.h" 21 21 22 using namespace std; 22 23 using namespace lol; 23 24 -
trunk/monsterz/mash.cpp
r746 r758 18 18 #include "core.h" 19 19 20 using namespace std; 20 21 using namespace lol; 21 22 -
trunk/monsterz/monsterz.cpp
r745 r758 21 21 #include "loldebug.h" 22 22 23 using namespace std; 23 24 using namespace lol; 24 25 25 #if defined HAVE_GLES_2X 26 #if defined __CELLOS_LV2__ 27 # include "ps3app.h" 28 #elif defined HAVE_GLES_2X 26 29 # include "eglapp.h" 27 30 #else … … 37 40 int main(int argc, char **argv) 38 41 { 39 #if defined HAVE_GLES_2X 42 #if defined __CELLOS_LV2__ 43 Ps3App app("Monsterz", vec2i(640, 480), 60.0f); 44 #elif defined HAVE_GLES_2X 40 45 EglApp app("Monsterz", vec2i(640, 480), 60.0f); 41 46 #else -
trunk/monsterz/piece.cpp
r750 r758 18 18 #include "core.h" 19 19 20 using namespace std; 20 21 using namespace lol; 21 22 -
trunk/monsterz/title.cpp
r756 r758 25 25 #include "core.h" 26 26 27 using namespace std; 27 28 using namespace lol; 28 29 -
trunk/src/debugfps.cpp
r686 r758 17 17 #include "core.h" 18 18 #include "debugfps.h" 19 20 using namespace std; 19 21 20 22 namespace lol -
trunk/src/debugquad.cpp
r745 r758 18 18 #include "lolgl.h" 19 19 #include "loldebug.h" 20 21 using namespace std; 20 22 21 23 namespace lol … … 160 162 attr_tex = data->shader->GetAttribLocation("in_TexCoord"); 161 163 164 #if !defined __CELLOS_LV2__ 162 165 glEnableVertexAttribArray(attr_pos); 163 166 glEnableVertexAttribArray(attr_col); … … 185 188 glDisableVertexAttribArray(attr_col); 186 189 glDisableVertexAttribArray(attr_tex); 190 #endif 187 191 } 188 192 -
trunk/src/debugrecord.cpp
r755 r758 21 21 #include "core.h" 22 22 #include "debugrecord.h" 23 24 using namespace std; 23 25 24 26 namespace lol -
trunk/src/debugsphere.cpp
r735 r758 24 24 #include "lolgl.h" 25 25 #include "debugsphere.h" 26 27 using namespace std; 26 28 27 29 namespace lol -
trunk/src/debugstats.cpp
r686 r758 17 17 #include "core.h" 18 18 #include "debugstats.h" 19 20 using namespace std; 19 21 20 22 namespace lol -
trunk/src/dict.cpp
r735 r758 21 21 # define strcasecmp _stricmp 22 22 #endif 23 24 using namespace std; 23 25 24 26 namespace lol -
trunk/src/font.cpp
r686 r758 13 13 #endif 14 14 15 #include < string.h>16 #include < stdio.h>15 #include <cstring> 16 #include <cstdio> 17 17 18 18 #include "core.h" 19 20 using namespace std; 19 21 20 22 namespace lol -
trunk/src/image.cpp
r735 r758 26 26 27 27 #include "core.h" 28 29 using namespace std; 28 30 29 31 namespace lol -
trunk/src/layer.cpp
r686 r758 16 16 17 17 #include "core.h" 18 19 using namespace std; 18 20 19 21 namespace lol -
trunk/src/lolgl.h
r748 r758 36 36 # include <OpenGLES/ES2/gl.h> 37 37 # include <OpenGLES/ES2/glext.h> 38 # elif defined __CELLOS_LV2__ 39 # include <PSGL/psgl.h> 40 # include <PSGL/psglu.h> 38 41 # else 39 42 # include <GLES2/gl2.h> -
trunk/src/map.cpp
r734 r758 20 20 21 21 #include "core.h" 22 23 using namespace std; 22 24 23 25 namespace lol -
trunk/src/matrix.cpp
r735 r758 17 17 18 18 #include "core.h" 19 20 using namespace std; 19 21 20 22 namespace lol -
trunk/src/matrix.h
r757 r758 114 114 inline float len() const \ 115 115 { \ 116 return s qrtf((float)sqlen()); \116 return std::sqrtf((float)sqlen()); \ 117 117 } 118 118 -
trunk/src/numeric.h
r748 r758 27 27 static inline float RandF() 28 28 { 29 return (float) rand() / RAND_MAX;29 return (float)std::rand() / RAND_MAX; 30 30 } 31 31 -
trunk/src/sample.cpp
r734 r758 24 24 25 25 #include "core.h" 26 27 using namespace std; 26 28 27 29 namespace lol -
trunk/src/scene.cpp
r745 r758 158 158 attr_tex = stdshader->GetAttribLocation("in_TexCoord"); 159 159 160 #if !defined __CELLOS_LV2__ // Use cgGetNamedParameter etc. 160 161 stdshader->Bind(); 161 162 uni_mat = stdshader->GetUniformLocation("model_matrix"); … … 163 164 uni_tex = stdshader->GetUniformLocation("in_Texture"); 164 165 glUniform1i(uni_tex, 0); 166 #endif 165 167 166 168 glEnable(GL_TEXTURE_2D); … … 209 211 glBindVertexArray(data->vao); 210 212 #endif 213 #if !defined __CELLOS_LV2__ // Use cgGLEnableClientState etc. 211 214 glEnableVertexAttribArray(attr_pos); 212 215 glEnableVertexAttribArray(attr_tex); … … 221 224 texture, GL_STATIC_DRAW); 222 225 glVertexAttribPointer(attr_tex, 2, GL_FLOAT, GL_FALSE, 0, 0); 226 #endif 223 227 224 228 /* Draw arrays */ … … 228 232 glBindVertexArray(0); 229 233 #endif 234 #if !defined __CELLOS_LV2__ // Use cgGLEnableClientState etc. 230 235 glDisableVertexAttribArray(attr_pos); 231 236 glDisableVertexAttribArray(attr_tex); 237 #endif 232 238 233 239 free(vertex); -
trunk/src/shader.cpp
r745 r758 80 80 GLsizei len; 81 81 82 #if !defined __CELLOS_LV2__ 82 83 data->vert_crc = Hash::Crc32(vert); 83 84 data->vert_id = glCreateShader(GL_VERTEX_SHADER); … … 104 105 glLinkProgram(data->prog_id); 105 106 glValidateProgram(data->prog_id); 107 #endif 106 108 } 107 109 108 110 int Shader::GetAttribLocation(char const *attr) const 109 111 { 112 #if defined __CELLOS_LV2__ 113 return 0; 114 #else 110 115 return glGetAttribLocation(data->prog_id, attr); 116 #endif 111 117 } 112 118 113 119 int Shader::GetUniformLocation(char const *uni) const 114 120 { 121 #if defined __CELLOS_LV2__ 122 return 0; 123 #else 115 124 return glGetUniformLocation(data->prog_id, uni); 125 #endif 116 126 } 117 127 118 128 void Shader::Bind() const 119 129 { 130 #if defined __CELLOS_LV2__ 131 ; 132 #else 120 133 glUseProgram(data->prog_id); 134 #endif 121 135 } 122 136 123 137 Shader::~Shader() 124 138 { 139 #if defined __CELLOS_LV2__ 140 ; 141 #else 125 142 glDetachShader(data->prog_id, data->vert_id); 126 143 glDetachShader(data->prog_id, data->frag_id); … … 129 146 glDeleteProgram(data->prog_id); 130 147 delete data; 148 #endif 131 149 } 132 150 -
trunk/src/text.cpp
r686 r758 18 18 19 19 #include "core.h" 20 21 using namespace std; 20 22 21 23 namespace lol -
trunk/src/tileset.cpp
r724 r758 25 25 #include "core.h" 26 26 #include "lolgl.h" 27 28 using namespace std; 27 29 28 30 namespace lol -
trunk/src/timer.cpp
r735 r758 22 22 # define WIN32_LEAN_AND_MEAN 23 23 # include <windows.h> 24 #elif defined __CELLOS_LV2__ 25 # include <sys/sys_time.h> 26 # include <sys/timer.h> 27 # include <sys/time_util.h> 24 28 #else 25 29 # include <SDL.h> … … 49 53 ms_per_cycle = 1e3f / tmp.QuadPart; 50 54 QueryPerformanceCounter(&cycles0); 55 #elif defined __CELLOS_LV2__ 56 ms_per_cycle = 1e3f / sys_time_get_timebase_frequency(); 57 SYS_TIMEBASE_GET(cycles0); 51 58 #else 52 59 SDL_Init(SDL_INIT_TIMER); … … 77 84 if (towait > 5e-4f) 78 85 Sleep((int)(towait + 0.5f)); 86 #elif defined __CELLOS_LV2__ 87 uint64_t cycles; 88 SYS_TIMEBASE_GET(cycles); 89 ret = ms_per_cycle * cycles; 90 if (update) 91 cycles0 = cycles; 92 towait = deltams - ret; 93 if (towait > 0.0f) 94 sys_timer_usleep((int)(towait * 1e3f)); 79 95 #else 80 96 /* The crappy SDL fallback */ … … 95 111 float ms_per_cycle; 96 112 LARGE_INTEGER cycles0; 113 #elif defined __CELLOS_LV2__ 114 float ms_per_cycle; 115 uint64_t cycles0; 97 116 #else 98 117 Uint32 ticks0; -
trunk/src/video.cpp
r755 r758 22 22 #include "core.h" 23 23 #include "lolgl.h" 24 25 using namespace std; 24 26 25 27 namespace lol … … 189 191 190 192 stdshader->Bind(); /* Required on GLES 2.x? */ 193 #if !defined __CELLOS_LV2__ // Use cgGetNamedParameter etc. 191 194 GLuint uni; 192 195 uni = stdshader->GetUniformLocation("proj_matrix"); … … 194 197 uni = stdshader->GetUniformLocation("view_matrix"); 195 198 glUniformMatrix4fv(uni, 1, GL_FALSE, &view_matrix[0][0]); 199 #endif 196 200 } 197 201 … … 221 225 { 222 226 GLint v[4]; 227 #if defined __CELLOS_LV2__ 228 // FIXME: use psglCreateDeviceAuto && psglGetDeviceDimensions 229 v[2] = 1920; 230 v[3] = 1080; 231 #else 223 232 glGetIntegerv(GL_VIEWPORT, v); 233 #endif 224 234 int width = v[2], height = v[3]; 225 235 … … 248 258 #if defined ANDROID_NDK 249 259 return saved_viewport; 260 #elif defined __CELLOS_LV2__ 261 // FIXME: use psglCreateDeviceAuto && psglGetDeviceDimensions 262 return vec2i(1920, 1080); 250 263 #else 251 264 GLint v[4];
Note: See TracChangeset
for help on using the changeset viewer.