Search found 485 matches

by MadPumpkin
Wed Jun 19, 2013 10:33 pm
Forum: Programming Discussion
Topic: [SOLVED] No image displayed at blit? (SDL, C++)
Replies: 9
Views: 6427

Re: [SOLVED] No image displayed at blit? (SDL, C++)

Exactly my thoughts :P. Though it is my fault for failing to include that, in my defense I'm not actually using .jpg's in my project (as of now or near future) I only was using an offhand one for testing. I had included the libpng dll I needed at least! Note to self: Test within actual boundaries of...
by MadPumpkin
Wed Jun 19, 2013 4:25 pm
Forum: Programming Discussion
Topic: [SOLVED] No image displayed at blit? (SDL, C++)
Replies: 9
Views: 6427

Re: [SOLVED] No image displayed at blit? (SDL, C++)

2 issues: I had forgotten to include the required jpeg libraries .dll in my project's folder. I had been loading an image into SDLTexture eye, before initializing SDL. I now know that this one is a no no and it makes sense. Thanks for the help, I managed to get it to show after commenting out all so...
by MadPumpkin
Mon Jun 17, 2013 9:12 pm
Forum: Programming Discussion
Topic: [SOLVED] No image displayed at blit? (SDL, C++)
Replies: 9
Views: 6427

Re: No image displayed at blit? (SDL, C++)

I have that in there because normally I use this for OpenGL rendering, but I would like to get SDL rendering functional since I haven't yet for this project. Commenting out those parts does not solve my problem, they function as intended (though I understand your point fully) EDIT: in fact I've alre...
by MadPumpkin
Mon Jun 17, 2013 11:41 am
Forum: Programming Discussion
Topic: [SOLVED] No image displayed at blit? (SDL, C++)
Replies: 9
Views: 6427

[SOLVED] No image displayed at blit? (SDL, C++)

All of my code compiles and runs fine, I've been struggling to get this working for a long while now. It seems as though there's something wrong with the method by which I'm blitting to the screen, as there is simply no image displayed. If it can be explained what is wrong with my implementation, I ...
by MadPumpkin
Fri Jun 14, 2013 2:52 am
Forum: Programming Discussion
Topic: [solved]fwrite not writing entire buffer? C++
Replies: 3
Views: 2682

Re: fwrite not writing entire buffer? C++

Heh thanks a lot, I hadn't even realized I was printing the address because of the trailing data being what I wanted it to be. Terrible mistake, thank you. I like your for loop suggestion as well. Thanks for your help. EDIT: Your loop doesn't seem to be working in export. My program writes no lumps ...
by MadPumpkin
Thu Jun 13, 2013 11:44 pm
Forum: Programming Discussion
Topic: [solved]fwrite not writing entire buffer? C++
Replies: 3
Views: 2682

[solved]fwrite not writing entire buffer? C++

I'm writing an archiving tool in C++ and I'm having a little issues with the way that fwrite is writing out it's last buffer in my export function. For simplicity and shortness I haven't included anything but those two functions, if it seems as though more information is required I'll give it... Thi...
by MadPumpkin
Thu Jun 13, 2013 10:40 pm
Forum: Programming Discussion
Topic: Per-pixel Destructible Terrain
Replies: 5
Views: 4973

Re: Per-pixel Destructible Terrain

Try checking out the source code for Open Liero Xtreme here: http://www.openlierox.net/ here's the Git information page they have. http://www.openlierox.net/wiki/index.php/Obtaining_OpenLieroX_source_from_Git I'm not sure how they perform destructible terrain particularly, but I know it's done per p...
by MadPumpkin
Sat May 18, 2013 10:50 pm
Forum: Programming Discussion
Topic: [SOLVED]SDL previous keystate system (Only works sometimes?)
Replies: 6
Views: 3274

Re: SDL previous keystate system (Only works sometimes?)

THat's what I just changed. If I don't call UpdateKeys() BEFORE the PollEvents loop in main, then it doesn't work.
by MadPumpkin
Sat May 18, 2013 10:41 pm
Forum: Programming Discussion
Topic: [SOLVED]SDL previous keystate system (Only works sometimes?)
Replies: 6
Views: 3274

[SOLVED]SDL previous keystate system (Only works sometimes?)

Hmm. Thanks for all help thus far :P. That doesn't appear to work though.

EDIT: It works! I did have to call the memcpy first, the reason it didn't work at first after changing it is because I was calling it in main, after SDL_PollEvents.

Thanks much for your help!
by MadPumpkin
Sat May 18, 2013 10:22 pm
Forum: Programming Discussion
Topic: [SOLVED]SDL previous keystate system (Only works sometimes?)
Replies: 6
Views: 3274

Re: SDL previous keystate system (Only works sometimes?)

Alright I attempted to change the code accordingly and now it doesn't work at all: SDLKeys::SDLKeys(void) { mPreviousKeys = new Uint8[SDLK_LAST]; mCurrentKeys = SDL_GetKeyState( NULL ); mMouseX = NULL; mMouseY = NULL; } SDLKeys::~SDLKeys(void) { delete[] mPreviousKeys; mCurrentKeys = NULL; } void SD...
by MadPumpkin
Sat May 18, 2013 5:00 pm
Forum: Programming Discussion
Topic: [SOLVED]SDL previous keystate system (Only works sometimes?)
Replies: 6
Views: 3274

[SOLVED]SDL previous keystate system (Only works sometimes?)

The issue I'm having is interesting. The function KeyHit() works now, but it appears to not always get the key input for some reason. By pressing q, it should negate the boolean renderQuuad. It does this, but only about half the time that I press q.. SDLKeys.h #pragma once #ifndef SDLKeys_h #define ...
by MadPumpkin
Tue Nov 06, 2012 5:38 pm
Forum: Programming Discussion
Topic: [Help?] C++ SDL unsuccesful screen blitting
Replies: 6
Views: 3359

Re: [Help?] C++ SDL unsuccesful screen blitting

Alright, well thanks for your help. I've abandoned the SDLScene pattern for a bit till I can rewrite it more efficiently anyway. Right now I've replaced it altogether with an SDLImage class, which the other SDLImage's draw to, then drawing to the screen. Which is essentially what I wanted anyway, bu...
by MadPumpkin
Mon Nov 05, 2012 10:10 pm
Forum: Programming Discussion
Topic: [Help?] C++ SDL unsuccesful screen blitting
Replies: 6
Views: 3359

Re: [Help?] C++ SDL unsuccesful screen blitting

There's both a

Code: Select all

SDL_Surface* sceneSurface()
which returns sceneSurface_; and a

Code: Select all

void sceneSurface ( SDL_Surface* surface)
which sets sceneSurface_ to the SDL_Surface given. I already know they're not causing the issue, because I use patterns like this all the time.
by MadPumpkin
Mon Nov 05, 2012 8:02 pm
Forum: Programming Discussion
Topic: [Help?] C++ SDL unsuccesful screen blitting
Replies: 6
Views: 3359

Re: [Help?] C++ SDL unsuccesful screen blitting

Yes, and no but it doesn't need to be, I installed it using the repos (Debian). If I remove SDLScene from the project altogether, and place the "drawSurface( whatever )" functions directly into SDLRenderer then it draws the images flawlessly because they're going directly to the screen buf...
by MadPumpkin
Sun Nov 04, 2012 6:40 pm
Forum: Programming Discussion
Topic: [Help?] C++ SDL unsuccesful screen blitting
Replies: 6
Views: 3359

[Help?] C++ SDL unsuccesful screen blitting

My code compiles and runs just fine, but it will not draw my loaded surface "definition.png". I have a class SDLRenderer and a class SDLScene. The scene has surface drawing functions, to it's member surface then the whole scene is passed to the renderer... The renderer contains a function:...