Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - deviouskoopa

Pages: [1]
1
C / Re: RenderWindow storage size unknown
« on: November 02, 2013, 03:59:02 pm »
Quote
Your code looks correct, passing NULL for the context settings parameter is explicitly allowed. Might be a bug in the debugger or runtime environment.

Thanks for the feedback, sounds reasonable so I'll ignore it. (As for Hungarian notation, I always use p_ and m_ out of habit; to each his/her own.)

2
C / Re: RenderWindow storage size unknown
« on: November 02, 2013, 12:30:04 am »
Okay thanks, I wasn't sure how to handle this since "new" is called for me in the CSFML binding. Although creating and drawing to the window seems to work, I get 4 console errors of "warning: Invalid parameter passed to C runtime function" when I execute this last line in my debugger:

static const char p_TITLE[] = "Game Title";
const sfVideoMode videoMode = { WINDOW_WIDTH, WINDOW_HEIGHT, BITS_PER_PIXEL };
sfRenderWindow * p_renderWindow = NULL;
p_renderWindow = sfRenderWindow_create(videoMode, p_TITLE, sfDefaultStyle, NULL);
 

Can these warnings be safely ignored? I can't tell which param(s) is invalid.

3
C / RenderWindow storage size unknown
« on: November 02, 2013, 12:01:44 am »
with sfFont, sfText, and sfRenderWindow, i want to initialize and create variables like:

sfVideoMode videoMode = { WINDOW_WIDTH, WINDOW_HEIGHT, BITS_PER_PIXEL };
sfRenderWindow renderWindow;
sfFont font;
sfText text;

&renderWindow = sfRenderWindow_create(videoMode, p_TITLE, sfDefaultStyle, NULL);
&font = sfFont_createFromFile(FILENAME_FONT);
&text = sfText_create();
 

but i get "storage size of RenderWindow isn't known" and similar errors. I don't really understand what the problem is, and CSFML's Types.h shows (which doesn't clarify anything for me):

typedef struct sfFont sfFont;
typedef struct sfRenderWindow sfRenderWindow;
typedef struct sfText sfText;
 

Can anyone explain my problem? Am I forced to initialize pointer types and _create functions while minding the scope? I'd ideally like to initialize the variables in one place then pass the pointers into a function that creates/sets their objects. This might not be possible though.

Thanks!

4
Just curious:
Is there a good reason that the sf::Text class stores a reference to the sf::Font instead of a sf::Font itself? Then you could copy from the reference in the setFont() function and wouldn't have to manage the lifecycle of the sf::Font separately... but maybe that's the intended use.

5
Graphics / Re: Pointer to sf::Text crashes when drawing to window
« on: June 29, 2013, 06:14:36 pm »
Wow that was definitely it, thank you! Can't believe it was that easy...

6
I'm having a strange issue with my SFML project. When I create a pointer for a sf::Text then draw it to the window in the same function scope, it works. However, when I create the sf::Text and store in a class in one function then draw from that member variable, it breaks in Debug mode with the message: "Unhandled exception at 0x77cc15de in TestSfmlApp.exe: 0xC0000005: Access violation reading location 0xccccccd0." Below is my project info and a condensed test program that fails for me.

System Info:
SFML 2.0 for "Visual C++ 10 (2010) - 32 bits"
Windows 7 64-bit, VS 2010

VS 2010 settings:
dynamic libs according to http://sfml-dev.org/tutorials/2.0/start-vc.php

Test program that crashes at line 42:
http://pastebin.com/L2XQeCdU
(but works when I remove lines 29-31 and 65)

Not sure if I copied the right stuff, but here's the call stack:
    ntdll.dll!77cc15de()    
    [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]   
    ntdll.dll!77cc15de()    
    ntdll.dll!77cb014e()    
    sfml-graphics-d-2.dll!5b80ad77()    
    sfml-graphics-d-2.dll!5b80cd56()    
    sfml-graphics-d-2.dll!5b80abae()    
    sfml-graphics-d-2.dll!5b80869a()    
    sfml-graphics-d-2.dll!5b805b2d()    
    sfml-graphics-d-2.dll!5b852986()    
    sfml-graphics-d-2.dll!5b8346e3()    
>   TestSfmlApp.exe!Game::Loop()  Line 42 + 0x1a bytes   C++
    TestSfmlApp.exe!main(int argc, char * * argv)  Line 66   C++
    TestSfmlApp.exe!__tmainCRTStartup()  Line 555 + 0x19 bytes   C
    TestSfmlApp.exe!mainCRTStartup()  Line 371   C
    kernel32.dll!770333aa()    
    ntdll.dll!77cd9ef2()    
    ntdll.dll!77cd9ec5()    


I've been stuck on this for 3-4 days now, but haven't found anything on forums or tutorials. Everything I read suggests the VS 2010 settings are wrong for linking the libraries, but I followed that link above exactly. Any suggestions?

Pages: [1]