From: <cad...@li...> - 2005-11-21 21:42:46
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns=3D"http://www.w3.org/1999/xhtml"> <head><style type=3D"text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: = #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:':';} #msg dl, #msg dt, #msg ul, #msg li { font-family: verdana,arial,helvetica= ,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; fo= nt-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padd= ing: 6px; } #msg ul, pre { overflow: auto; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt= ;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:aut= o;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patc= h .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 = 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 = 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[263] tiki/sdl/src: SDL openAL updates</title> </head> <body> <div id=3D"msg"> <dl> <dt>Revision</dt> <dd>263</dd> <dt>Author</dt> <dd>atani</dd> <dt>Date</dt> <dd>2005-11-21 13:34:49 -0800 (Mon, 21 Nov 2005)</dd> </dl> <h3>Log Message</h3> <pre>SDL openAL updates</pre> <h3>Modified Paths</h3> <ul> <li><a href=3D"#tikisdlsrcinit_shutdowncpp">tiki/sdl/src/init_shutdown.cp= p</a></li> <li><a href=3D"#tikisdlsrcplathidcpp">tiki/sdl/src/plathid.cpp</a></li> </ul> </div> <div id=3D"patch"> <h3>Diff</h3> <a id=3D"tikisdlsrcinit_shutdowncpp"></a> <div class=3D"modfile"><h4>Modified: tiki/sdl/src/init_shutdown.cpp (262 = =3D> 263)</h4> <pre class=3D"diff"> <span class=3D"info">--- tiki/sdl/src/init_shutdown.cpp 2005-11-21 04:55:= 17 UTC (rev 262) +++ tiki/sdl/src/init_shutdown.cpp 2005-11-21 21:34:49 UTC (rev 263) </span><span class=3D"lines">@@ -8,19 +8,43 @@ </span><span class=3D"cx">=20 </span><span class=3D"cx"> #include "pch.h" </span><span class=3D"cx">=20 </span><ins>+#include <AL/al.h> +#include <AL/alut.h> + </ins><span class=3D"cx"> #include "Tiki/sound.h" </span><span class=3D"cx"> #include "Tiki/stream.h" </span><span class=3D"cx"> #include "Tiki/plxcompat.h" </span><span class=3D"cx"> #include "Tiki/hid.h" </span><del>-#include <SDL/SDL_video.h> </del><ins>+#include <SDL/SDL.h> </ins><span class=3D"cx">=20 </span><span class=3D"cx"> namespace Tiki { </span><span class=3D"cx">=20 </span><span class=3D"cx"> bool init(int argc, char **argv) { </span><del>- alutInit(&argc, argv); </del><ins>+ if(SDL_Init(SDL_INIT_EVERYTHING | SDL_INIT_EVENTTHREAD | SDL= _INIT_NOPARACHUTE) < 0) + { + fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetErr= or()); + return false; + } + ALCdevice *dev; + ALCcontext *context; </ins><span class=3D"cx">=20 </span><del>- Audio::Sound::initGlobal(); - Audio::Stream::initGlobal(); </del><ins>+ dev =3D alcOpenDevice("sdl"); + if(dev =3D=3D NULL) + { + fprintf(stderr, "alcOpenDevice returned NULL: %s\n", alGetEr= ror()); + return false; + } + context =3D alcCreateContext(dev, NULL); + if(context =3D=3D NULL) + { + fprintf(stderr, "alcCreateContext returned NULL: %s\n", alGe= tError()); + return false; + } + alcMakeContextCurrent(context); + alutInitWithoutContext(&argc, argv); + + Audio::Sound::initGlobal(); + Audio::Stream::initGlobal(); </ins><span class=3D"cx"> GL::Plxcompat::plx_mat3d_init(640, 480); </span><span class=3D"cx"> return Hid::init(); </span><span class=3D"cx"> } </span></pre></div> <a id=3D"tikisdlsrcplathidcpp"></a> <div class=3D"modfile"><h4>Modified: tiki/sdl/src/plathid.cpp (262 =3D> 2= 63)</h4> <pre class=3D"diff"> <span class=3D"info">--- tiki/sdl/src/plathid.cpp 2005-11-21 04:55:17 UTC= (rev 262) +++ tiki/sdl/src/plathid.cpp 2005-11-21 21:34:49 UTC (rev 263) </span><span class=3D"lines">@@ -57,19 +57,6 @@ </span><span class=3D"cx"> evtMouse.dev =3D SDLMouse; </span><span class=3D"cx"> sendEvent(evtMouse); </span><span class=3D"cx">=20 </span><del>- if(SDL_Init(SDL_INIT_EVERYTHING | SDL_INIT_EVENTTHREAD | SD= L_INIT_NOPARACHUTE) < 0) - { - fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetErr= or()); - return false; - } - - //if(SDL_SetVideoMode(320, 240, 16, SDL_OPENGL) =3D=3D NULL) - if(SDL_SetVideoMode(640, 480, 16, SDL_OPENGL) =3D=3D NULL) - { - fprintf(stderr, "Unable to Create OpenGL Window: %s\n", SDL_= GetError()); - return false; - } - </del><span class=3D"cx"> SDL_WarpMouse(0, 0); </span><span class=3D"cx">=20 </span><span class=3D"cx"> char junk =3D '0'; </span></pre> </div> </div> </body> </html> |