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

Pages: [1]
1
Graphics / sf::Image.LoadFromFile might be causing invalid pointers?
« on: February 25, 2010, 12:38:24 pm »
Wow, thanks. It worked. =)

2
Graphics / sf::Image.LoadFromFile might be causing invalid pointers?
« on: February 25, 2010, 12:30:15 pm »
Release. Should I try the debug ones?

3
Graphics / 512x512 texture slowing game down
« on: February 25, 2010, 03:34:48 am »
Quote from: "wademcgillis"
Quote from: "OniLink10"
I've done a comparison of Game Maker and SFML before. SFML was much faster at everything. It's most likely your code. Also, your code is VERY messy and unsafe. You call new a lot but I don't see you calling delete anywhere!


How do I call new "a lot"? Each new only gets called once, it's not like it's a memory leak since the game goes out of memory when it closes.


Also, my code is very readable in my perspective. I'd probably think your code is very messy too.


If you have pointers pointing to a variable using new, then the pointers go out of scope but the data they point to doesn't.

4
Graphics / sf::Image.LoadFromFile might be causing invalid pointers?
« on: February 25, 2010, 02:04:17 am »
Hello,

I'm getting this really weird problem in my SFML/OpenGL application. I've created my application, which should render a triangle in multiple colors and then a square with a texture on it. I used SFML's texture loading for my texture, but then I ran into this really weird problem. I'm sure it's this line specifically because I commented out everything else and it still happened. When I run my program, it beeps once about ever third of a second, and shows a bunch of stuff in the console, and then it crashes saying that the OpenGL buffer got overrun (even when I don't use OpenGL). Here's my code:

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

int main() {
sf::Window window(sf::VideoMode(800, 600), "Rendering", sf::Style::Close);

sf::Image image;

        //Problem line....
if(!image.LoadFromFile("Texture.png")) {
return 1;
}

GLuint textureID;
glGenTextures(1, &textureID);
glBindTexture(GL_TEXTURE_2D, textureID);

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.GetWidth(), image.GetHeight(),
0, GL_RGB, GL_UNSIGNED_BYTE, image.GetPixelsPtr());

glClearDepth(1.0f);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0f, 1.0f, 1.0f, 500.0f);

while (window.IsOpened()) {
sf::Event evnt;
while(window.GetEvent(evnt)) {
switch(evnt.Type) {
case sf::Event::Closed:
window.Close();
}

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

glTranslatef(-1.5f,0.0f,-6.0f);

glBegin(GL_TRIANGLES);
glColor4f(0.0f,255.0f,255.0f,255.0f);
glVertex3f( 0.0f, 1.0f, 0.0f);

glColor4f(255.0f,0.0f,255.0f,255.0f);
glVertex3f(-1.0f,-1.0f, 0.0f);

glColor4f(255.0f,255.0f,0.0f,255.0f);
glVertex3f( 1.0f,-1.0f, 0.0f);
glEnd();

glTranslatef(3.0f,0.0f,0.0f);
glRotatef(-25.0f, 0.0f, 1.0f, 0.0f);

glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, textureID);

glBegin(GL_QUADS);
glTexCoord2f(1.0f,1.0f);
glVertex3f( -1.0f, 1.0f, 0.0f);
glTexCoord2f(0.0f,0.0f);
glVertex3f(-1.0f,0.0f, 0.0f);
glTexCoord2f(1.0f,0.0f);
glVertex3f( 0.0f,0.0f, 0.0f);
glTexCoord2f(1.0f,1.0f);
glVertex3f( 0.0f,1.0f, 0.0f);
glEnd();

glDisable(GL_TEXTURE_2D);

window.Display();
}
}

return EXIT_SUCCESS;
}


And here's the error I get in a pop-up window asking me to break/continue the program.

Code: [Select]
Unhandled exception at 0x737a84b4 in OpenGL render.exe: 0xC0000005: Access violation reading location 0x003e9000.

I'm running a Radeon HD 5850 with SFML 1.5 prebuilt. Thanks for any help.

5
DotNet / .NET Interface
« on: February 23, 2010, 09:09:08 pm »
Sweet, that's all the stuff I needed. SFML is great, thanks.

6
DotNet / .NET Interface
« on: February 23, 2010, 07:59:07 pm »
Hello,

I'm trying to use SFML in C#, because I'm porting some C++ code over for a level editor. I have a few questions about what it can do before I follow that path.

1- Can SFML be rendered in a Windows Form control? I am setting up the UI and serialization stuff in C# now, but will it be as simple as dragging in a render window for SFML into the tab control I have set up, or could I render into the tab control or a panel?

2- Does SFML allow me to use OpenGL with SFML in C#? I've seen some things like the Tao Framework. Can I just use the OpenGL functions from Tao in the SFML control, like I would with normal SFML?

3- Can I just port my C++ library to a C# library and use my own interfaces based on SFML?

I want the editor to be WYSIWYG, so I need to find a way to get identical rendering and audio on both C++ and C# with minimal effort, which is one reason I chose SFML. Thanks,

7
General discussions / [Seeking] Easy 3d-model loading library
« on: January 30, 2010, 02:38:08 pm »
Assimp- nice! I'll definitely check it out, seems to be much less complex than something like OGRE and doesn't require the Horde3D-specific config/asset files(which I hate), so it's definitely worth a look. It doesn't seem to be meant for use in games directly with model files though, so I'll have to create my own model type, which isn't much of a problem. I'll probably just create an exporter for 3DS Max to the file format which I create, or maybe an application using Assimp that takes in any type of file and converts it to my own file type.

8
General discussions / [Seeking] Easy 3d-model loading library
« on: January 30, 2010, 12:25:13 am »
I think it would be better to just be able to load it in SFML and then render it yourself, that way, you can have full control over your model rendering process. 3D model loading might be good, but rendering them is not really worth it when most people will have to change it anyways. I am going to start working with loading in a model in my SFML application, so I might make a small utility for loading in models from .3DS, but I won't have much time to work on it or maintain it if I do it at all.

9
Feature requests / 3D additions
« on: January 29, 2010, 11:58:52 pm »
A game engine would be cool. I'd help with that. It'd need physics/collision though (supporting concave polygons).

10
Feature requests / XML parsing
« on: January 29, 2010, 11:57:05 pm »
I think serialization would be good. Even though he mentioned XML, doesn't mean it couldn't be done with some other serialization method. About just plugging in external libraries instead of making the SFML developer(s) do it, don't a lot of things in SFML use external libraries also, like the networking and image loading? IDK why using an external library would be a problem. The serialization language the data is in shouldn't matter too much as long as we can easily load it, view/edit it, and save it back in. This would be especially good for game levels, config files, custom(optimized) file formats, etc. This would end up being useful in almost anything to do with multimedia, so why shouldn't it go in a multimedia library?

Pages: [1]
anything