| |
| |
| |
|
Comments:
<0> Is SDL 1.3 going to introduce a way to easily manipulate GL contexts internally? <1> hi there, I just ported SDL to Plan 9, it is still a bit rough on the edges (only took me a few hours so far) but I was wondering what is the standard procedure to have a new port integrated into the main tree... <2> Hiya <2> When you're using SDL for 2D, do you usually require the surface used for drawing to be a specified BPP, or od you account for varying BPPs in your code+ <2> Currently I cast surface->pixels to unsigned char *, then do pixels[(x + y * surface->w) * surface->format->BytesPerPixel + surface->format->Rshift / 8] = 0xFF (to set red, e.g.) <2> But it's pretty nasty. <2> Anyone have any cleaner solutions? <1> daxxar: no, sorry, I have no clue about the SDL client api, I only hacked on the backend so far :) <1> but your way doesn't sound like a very good idea.. <2> I didn't think so either. <1> if you get a choice of bpp, I would use 32bit everywhere, and be done with it.. <2> Well, I'm the sole creator of this app, it's a small 2d multiplayer game I'm craeting. <2> Are there any issues running winowed mode with a different bpp than the desktop?
<2> windowed. <1> there should not be... <1> but then, in the Plan 9 video driver I just implemented 32bit depth and to hell with it ;P (who is not running 32bit depth this days anyway?) <3> sdl will just convert it anyway, but if your already using software surfaces you'll always get the final updaterect blit overhead <2> I'm using HW surface <2> Shouldn't I be? <2> :o <3> if your running windowed you'll most likely be having a software surface for most backends <2> Okay <1> I'm going to sleep, if someone wants to take a look at the Plan 9 port here is a tarball: http://plan9.bell-labs.com/sources/contrib/uriel/sdl-1.2.11-test.tgz (very rough, just wanted to get it running) <2> Hm, is there any simple way to rotate aSurface? <2> I'm creating a game, and I'm going to blit a "sprite" to the videoscreen, but the player should be able to rotate it. <2> Hm, the ml talks about SDL_rotozoom which I can't find on the libraries list. GOing to look into SDL_gfx though <2> Oh, rotozoomer is a part of sdl_gfx ;P <3> part of yeh :) <2> One usually uses SDL_FillRect to 'clear' the screen? <2> SDL_Rect r; r.x = 0; r.y = 0; r.w = surface->w; r.h = surface->h; SDL_FillRect(surface, &r, 0) <3> or use NULL as rectangle for the full screen <4> Usually SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, r, g, b)) <2> Ah, thanks. <5> hello <2> Hi <5> I'm new to SDL <5> I followed this tutorial (which is great btw): http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/tut1 <5> my question is, I need to draw a bitmap to the screen, but I already have my code to load images <5> for now I'm using DrawPixel function (from that tutorial) <5> buw I think it would be more efficient to create a new surface with the image and then blitting... <2> You're loading an image from file, then looping over it and calling the DrawPixel thing? :o <5> sort of... :< <2> Well, yes. Blitting is probably a better idea. How're you loading the image? <2> I can reccomend SDL_image ;-) <2> recommend* <5> hey it's like second thing I do on SDL, first one was that yellow/blue gradient on the tutorial :) <2> Hehe, of course, if I sound rude, I do not mean it. I'm not very experienced with SDL either. :-O) <2> :-)* <5> SDL_image... yeah, but I'm already doing this in a different way <5> the way my code is done now, it's like I'm adding SDL as a 'platform' :P <2> Haha, that tutorial has a comment: <2> <2> ed <2> wow a nice tut tho the language ****s partially i mean spelling etc. 'initally' wtf hurts my eyes well mby thats coz im not a native speaker so ive had to learn the precise way in which to spell wrds <2> <5> ... <2> Gotta love people who comment on language but write stuff like "ive" and "wrds" and "mby". I hope he's being ironic. <5> complain about his language AFTER looking at your own, ed! <2> PovAddict, so you load an image to a memory-block, in plain raw RGB(A)-format? <5> the image loader and other parts of my game are already coded without SDL in a cross-platform way <5> plain raw RGB, yeah
<5> I get them row by row (libjpeg) <2> Yeah, then I'd recommend using SDL_CreateRGBSurface and loading directly into the pixel-buffer ther,e or using SDL_CreateRBGSurfaceFrom on the loaded data. <5> exactly <5> I use SDL_CreateRGBSurface and then I don't know how to load to pixel buffer ^^ <2> SDL_Surface *s = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 24, ...); loadFromImageToBuffer(s->pixels); ? <5> ohh so I write to s->pixels directly? <2> Yeah, but you might have to run SDL_LockSurface() before and SDL_UnlockSurface() after. <2> (You can check SDL_MUSTLOCK(s) to see if it's required, it'll return 1 if you have to call SDL_LockSurface()) <5> been there done that :) <5> I had to do that to draw to screen too <2> I'm pretty fresh to SDL and 2d-stuff, so I don't know what the exact conditions for locking to be required is. <2> I've mostly used SDL for OpenGL <5> ok so... <5> what's the format for s->pixels? <5> RGBRGBRGBRGBRGBRGBRGB? <2> Depends on s->format. :-) <2> Read the docs on SDL_Format (iirc) to see how to figure it out. <5> but, all rows are one next to the other? <2> Yep <2> s->format->Rshift, Bshift, etc. <5> I ask because, for example in libjpeg an image is an array of *pointers* to rows <2> Aha, okay. Both OpenGL and SDL wants it as one big chunk of data. :-) <5> then the rows are RGBRGBRGB... <5> kewl <5> so, when my image_change callback is called from my game code, I put new data into the sdlsurface :) <5> sounds simple <5> hmm should I use SDL_MapRGB? <5> nevermind, I dont need to use it since I set bpp explicitly :) <5> question <5> can I keep Amask to 0x00? <5> it's 24bpp <2> Probably, :-) <2> I'm guessing you just set Amask to 0, BitsPerPixel to 24 and you should be there. <5> I would like my IDE to be semitransparent and to be able to play MPEG in the background :P <5> although MPEG playing uses video overlays usually, I don't think I can have a transparent text editor over that :P <5> but still, programming in a semitransparent editor with www.electricsheep.org in background would look great ^^ <2> Use Linux and XGL. ;-) <5> XGL <3 <5> ! <2> Should allow you to set any window as semitransparent, since it uses OGL for rendering stuff. ;-) <5> actually I can put semitransparent stuff over electricsheep, but trans window flickersss <5> HUGE flicker if window is big <5> so... XGL <3 <2> :-) <5> DARN <5> my code wasn't working, turned out I was copying from the screen to the memory surface... parameter order mistake... <5> that's much better \o/ <2> PovAddict, yay! \o/ <6> hi. <6> is it possible to use the SDL without X? <6> (under linux) <6> all i want is hardware acceleration (opengl) without having to use X <7> nope. <5> hello again :) <5> what happens if I use SDL_BlitSurface to draw to the screen, and I use negative or off-screen rects? <5> will it clip the non-visible parts or go and corrupt some memory? :D
Return to
#sdl or Go to some related
logs:
#debian mypdb python flared cock installing only ubuntu-minimal pyode collision ubuntu toolbar placement date_diff mssql cdemu automatic install #web #math
|
|