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 - Glue

Pages: [1]
1
General / Failed to loadfromfile()
« on: January 25, 2011, 04:20:39 pm »
Put my back.jpg into the project directory, still the same thing.

Also this is integrated into Win32, the output you speak of I do not have.

EDIT:

Well, i found a solution, the name of my exe was "render test.exe" so i changed it to render.exe and now it shows the jpg perfectly.

Aka, It doesn't like the spaces and i just realised i've never seen a exe with spaces like that.

2
General / Failed to loadfromfile()
« on: January 25, 2011, 03:54:54 pm »
Uhm, How do you mean standard output?  :roll:

3
General / Failed to loadfromfile()
« on: January 25, 2011, 03:48:34 pm »
Hello, once again i get problems, but this time there isn't any errors. The LoadFromFile() function simply fails to do what it's supposed to do.

Code: [Select]
if(!this->Image.LoadFromFile("back.jpg"))
{
MessageBox(ghWnd,L"Doesnt Work",L"Cant Load",MB_OK);
}


Yes, back.jpg is in the same directory as the exe compiled. I have tried to run it from there too, same thing.


Suggestions?
Release Static
SFML 2
Windows 7
MSVC++ Express 2010

4
General / Access Violation.
« on: January 24, 2011, 09:09:25 pm »
SO I decided to create window using the
Code: [Select]
Window var(sf::VideoMode(800,600,32), "windowname");

However when it got to this point it gave me another access violation. I guess there is something with the Win32 API and SFML?

NOTE: I commented out the code relevant to creating a window with CreateWindow and such alike.

Code: [Select]

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lp,int nCmdShow)
{ /*
WNDCLASS WindowClass;
WindowClass.style         = 0;
WindowClass.lpfnWndProc   = &WndProc;
WindowClass.cbClsExtra    = 0;
WindowClass.cbWndExtra    = 0;
WindowClass.hInstance     = hInstance;
WindowClass.hIcon         = NULL;
WindowClass.hCursor       = 0;
WindowClass.hbrBackground = reinterpret_cast<HBRUSH>(2);
WindowClass.lpszMenuName  = NULL;
WindowClass.lpszClassName = L"testclass";
RegisterClass(&WindowClass);
*/
// Let's create the main window
//HWND Window = CreateWindow(L"testclass", L"Orly", WS_SYSMENU | WS_VISIBLE, 0, 0, 800, 600, NULL, NULL, hInstance, NULL);

//DWORD Style = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
//HWND View1 = CreateWindow(L"STATIC", NULL, Style, 50,  25, 700, 515, Window, NULL, hInstance, NULL);
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");


MSG Message;
Message.message = ~WM_QUIT;
while (Message.message != WM_QUIT)
{
if (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&Message);
DispatchMessage(&Message);
}
else
{
//for(unsigned int index = 0;index > Oblist.size();index++)
//{
App.Display();
//}
}
}

//DestroyWindow(Window);

// Don't forget to unregister the window class
//UnregisterClass(L"testclass", hInstance);

return EXIT_SUCCESS;
}


EDIT:

Well apparently i can create a window in debug, release gives the access violation and now when i try the original application in debug i get (0xc0150002) And i find that extremely funny.  :cry:

EDIT1:

I got the SVN and compiled it. Apparently it likes the static debug so I'm gonna try the static release later too.  8)

5
General / Access Violation.
« on: January 24, 2011, 08:38:00 pm »
Well, I can create a window using SFML if that's what youre asking.



Code: [Select]
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML\Window.hpp>


////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main window
    sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");

    // Start main loop
    bool Running = true;
    while (Running)
    {
        App.Display();
    }

    return EXIT_SUCCESS;
}


This works fine after I link the proper libraries.

6
General / Access Violation.
« on: January 24, 2011, 08:17:43 pm »
This shows up in release and that is the full code, globalfuncs.cpp simply contains the WndProc definition and global.h:

Code: [Select]
#pragma once

#include <SFML/Graphics.hpp>

LRESULT CALLBACK WndProc(HWND hWnd, UINT msg,WPARAM wParam,LPARAM lParam);


I put the dependencies into the Linker->Input->Additional Dependencies in the same order as i said before so the #pragma comments is no longer in the code.

Also the sfml-stuff-s.lib's are the static libraries or?

7
General / Access Violation.
« on: January 24, 2011, 06:39:46 pm »
Well, I'm using Nvidia so I dont know about that. I could try using the static, but first I'm gonna have to figure how to do that.

And thank you for atleast trying to help me. :)

8
General / Access Violation.
« on: January 24, 2011, 06:29:29 pm »
I did as you said and this is my order now:
1.System
2.Window
3.Graphics

However the buffer overrun error still shows up whenever I exit the application.

Code: [Select]
#if defined (_CRTBLD) && !defined (_SYSCRT)
    DebuggerWasPresent = IsDebuggerPresent();
    _CRT_DEBUGGER_HOOK(_CRT_DEBUGGER_GSFAILURE); // This line.
From "gs_report.c"

This is what it shows me.

9
General / Access Violation.
« on: January 24, 2011, 06:23:13 pm »
Code: [Select]
#pragma comment(lib,"sfml-graphics.lib")
#pragma comment(lib,"sfml-window.lib")


This is inside the global.h and I'm using SFML 1.6.

10
General / Access Violation.
« on: January 24, 2011, 05:57:14 pm »
Hello so, I downloaded the SFML SDK and got it set up etc. Linked the correct libraries to the configuration (release to release,debug to debug etc) and tried to compile the source code from the "Integrating with Win32" example.

This gives me an access violation during runtime and it points me at
Code: [Select]
sf::RenderWindow SFMLView2;

So, i decide to remove that certain line and run it, now it gives me another error during runtime:
"A buffer overrun has occurred in sfmltesting.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'."

The whole source code:
Code: [Select]
#include "global.h"

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lp,int nCmdShow)
{
WNDCLASS WindowClass;
WindowClass.style         = 0;
WindowClass.lpfnWndProc   = &WndProc;
WindowClass.cbClsExtra    = 0;
WindowClass.cbWndExtra    = 0;
WindowClass.hInstance     = hInstance;
WindowClass.hIcon         = NULL;
WindowClass.hCursor       = 0;
WindowClass.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_BACKGROUND);
WindowClass.lpszMenuName  = NULL;
WindowClass.lpszClassName = L"testclass";
RegisterClass(&WindowClass);

// Let's create the main window
HWND Window = CreateWindow(L"testclass", L"Orly", WS_SYSMENU | WS_VISIBLE, 0, 0, 800, 600, NULL, NULL, hInstance, NULL);

DWORD Style = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
HWND  View1 = CreateWindow(L"STATIC", NULL, Style, 50,  100, 300, 400, Window, NULL, hInstance, NULL);

sf::RenderWindow SFMLView1;
SFMLView1.Create(View1);

MSG Message;
Message.message = ~WM_QUIT;
while (Message.message != WM_QUIT)
{
if (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&Message);
DispatchMessage(&Message);
}
else
{
// SFML rendering code goes here
}
}

DestroyWindow(Window);

UnregisterClass(L"testclass", hInstance);

return EXIT_SUCCESS;
}


As you can see I am merely trying to create those so-called "sfmlviews". It works fine if I remove the


Code: [Select]

sf::RenderWindow SFMLView1;
SFMLView1.Create(View1);


It shows me one box to the left.

I am using VC++ Express 2010 and i have recompiled the library without errors and i have told the linker where to find the lib's. Anyone wants to shed some more light on this?

P.S. global.h only contains the declaration for WndProc and  #include <SFML\Graphics.hpp>  + the definition for WndProc is inside another .cpp file.

I am running Windows 7 atm.

Pages: [1]