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.


Topics - deviouskoopa

Pages: [1]
1
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!

2
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]
anything