• Advertisement

blackcloak

Member
  • Content count

    114
  • Joined

  • Last visited

Community Reputation

189 Neutral

About blackcloak

  • Rank
    Member
  1. Using the SDL_gfx library?

    SDL_Surface * NewRotatedSDLSurface = rotozoomSurfaceXY(_ImageToDraw->GetSDLSurface(), _ImageToDraw->GetRotation(),_ImageToDraw->GetScalingFactorX(),_ImageToDraw->GetScalingFactorY() ,_ImageToDraw->GetAntiAliased()); where //_ImageToDraw->GetSDLSurface() is a SDL_Surface * //_ImageToDraw->GetRotation() is a double //_ImageToDraw->GetScalingFactorX() is a double //ImageToDraw->GetScalingFactorY() is a double //_ImageToDraw->GetAntiAliased() //#define SMOOTHING_OFF 0 // #define SMOOTHING_ON 1 returns a new rotated / scaled SDL_Surface then blit NewRotatedSDLSurface to your screen
  2. Need C++ Audio Library

    " (- providing information about the position (in samples) of all currently playing wave files)" A few years back I made a music rhythm game, and I was syncing sprite movement to music. FMOD was the only lib that could do this reliable. I looked at all sound libs available and FMOD is really the best one.
  3. Using the SDL_gfx library?

    Yeah this has always been a pain of using SDL_GFX ( the fact you have to compile libs your self). Here is a site that has a built lib of SDL_GFX for windows SDL_GFX binaries for windows Then you can add them just as you did with SDL or SDL_TTF. I know you can do it in dev cpp since i have done it my self.
  4. source control on google code

    There is BitBucket it offers private repository for up to five users for free, and unlimited for open source projects. Comes with a wiki and issue tracker as well.
  5. OpenGL painting texture

    You can write a Shader to do this.
  6. SDL animation array

    Quote:Blackcloak: Is a 122kb cpp file plus a 40kb header file a bit to much to have in one file? Definitely it is on my list of todos to break them into separate files and provided static libs that you can link against. Original I had them in two file for easy distribution since I have not had the time to make the static libs. Quote:Btw, using "SDL_Event& event;" and "event.key.keysym.sym;" a bit later in some other part of the code causes almost 500 warnings. If this is referring to my engine code, good to know will into it. thanks BTW there are a list of Know Bugs
  7. SDL animation array

    like rip-off says there are many issues with how you are using pointer in your function first off like rip-off says you can't do this SDL_Surface* loaded_image=NULL;//must load as a NULL for init SDL_Surface* optimized_image=NULL; *loaded_image=*sprite_image;//the real init in this program loaded_image is NULL and you can't dereferences NULL you can do this loaded_image=sprite_image however it is pointless if sprite_image is NULL and if want this function to work like this "array_containing_animations[number]=load_sprite(spritesheet.gif, 0,0,30,50);" you need to have a load function call in this function. SDL_LoadBMP or IMG_Load. and the function needs to return a SDL_Surfaces * my clipping function (which could use a little clean up) in my engine is the function void Animation::SetClipingBoxForFrame() and the loading a image from file is bool image::LoadFileSurface()
  8. SDL animation array

    Quote:Btw, we're using including SDL_image in our project, so that should be no hinderance. Then to load the image using SDL_image its IMG_Load(FlieName) instead of SDL_LoadBMP(FileName) Quote:The thing is that I know how big each array is going to be, and I think that a array will suit our needs (it's a two-man project), since we already has one array but it's way to funky code and messy. And it assumes that the sprites is perfectly aligned. The current one (not the code I'm trying to write)is extremely horrible (it's mostly taken from an example), it works but it's a headache to look at... Then just ignore my comments about std::vector sounds like you know what you are doing with using arrays. also you can get a lot of help from the SDL mailing list
  9. SDL animation array

    SDL only supports BMP. the SDL_Image Lib supports BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF, XCF, XPM, XV so this is how you would LoadBMP using SDL bool Sprite::load_sprite(const & std::string sprite_image, int startx, int starty, int width, int height){ //blit clip uses the 4 integers over SDL_Rect clip;//where to clip SDL_Surface* loaded_image=SDL_LoadBMP(sprite_image.c_str()); //sprite_image being a file name like MyImage.bmp if (loaded_image == NULL) { //error return false; } SDL_Surface* optimized_image=NULL; optimized_image=SDL_DisplayFormat(loaded_image); SDL_FreeSurface(loaded_image); if (optimized_image == NULL) { //error return false; } my_sprite_array[x] = optimized_image; // or my_sprite_vector.push_back(optimized_image) clip.x=startx; clip.y=starty; clip.w=width; clip.h=height; SDL_BlitSurface(optimized_image, &clip, NULL, NULL); return true;} check the link in my signature if you want more exmples using SDL. I wrote a graphics engine using SDL. Though I used SDL_Image for loading image files from file. I would also recommend using std::vector instead of an array since you mostly don't know how many sprite you will load in. [Edited by - blackcloak on November 18, 2010 2:43:09 PM]
  10. Inventory/Item design needing suggestions

    You can do a dynamic_cast on the Item pointer to a Armor pointer and that would allow you to access the Armor methods. If the Item pointer is not a Armor instance it will return NULL. Your Item pointer is basically and interface. You can Google interface for more information. if(dynamic_cast<Armor*>(ItemList[i]) != NULL) { dynamic_cast<Armor*>(ItemList[i])->SomeArmorFuntion(); } just a word of warning dynamic_cast are slower than static casts
  11. C++0x library documentation?

    If you want the beading edge Wikipedia has a link to the most current Working Draft, Standard for Programming Language C++ published 08-21-2010 Cpp 0x [Edited by - blackcloak on November 18, 2010 10:03:31 AM]
  12. DirectX Red Book Equivalent?

    Like NightCreature83 said there is no red book for DirectX. However this is the best book I have found on learning DirectX. Introduction to 3D Game Programming with Direct X 9.0c: A Shader Approach The newer versions use DirectX 10 or 11
  13. SDL TTF text not working when OpenGL is initialized

    You will have to convert the sdl surface that sdl ttf gives you (sText in you code) to an opengl texture and then render that on a polygon. Other wise you will need to use a different library to get create the texture. There are many examples of this on the web or you can use my engine's font render code as and example (see link under my signature). It use SDl TTF and sdl with opengl
  14. Educational Material Suggestion?

    I was going to recommend this book for XNA (Professional XNA Programming: Building Games for Xbox 360 and Windows with XNA Game Studio 2.0) but since it have not been updated for 3.1 I will suggest this site for XNA I can't recommend any c# books since i taught my self with out one.
  15. Help choosing sound API

    this was discussed a little while back here is the tread post. I think FMOD is the best for cross platform. also Audiere is not bad but it may not have all the 3D sound support you need.
  • Advertisement