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

Pages: 1 ... 15 16 [17] 18
241
Graphics / sf::RenderImage::Create extremely slow
« on: May 14, 2011, 11:04:13 pm »
It actually gave me 2.52619 secs when I tried that.

242
Graphics / sf::RenderImage::Create extremely slow
« on: May 14, 2011, 10:57:55 pm »
Yes. I had to change it to this so I could actually tell how much time went by:

Code: [Select]

int main()
{
system("pause");
    sf::RenderImage rimage;
    rimage.Create(128, 128);
system("pause");
    return 0;
}


Still a 1 - 2 sec lag.

243
Graphics / sf::RenderImage::Create extremely slow
« on: May 14, 2011, 10:26:35 pm »
Yup, it actually takes 1-2 secs to create it, the whole game freezes for a bit when the render image creation code is executed.
I don't think it has anything to do with any operations before or afterwards as their aren't any besides rendering, which works at 60fps (after the images were created). The lag occurs even when I don't render to the image. If I simply comment out the image creation line it runs smoothly at 60fps all the time.

244
Graphics / sf::RenderImage::Create extremely slow
« on: May 14, 2011, 08:17:05 pm »
I have a game in which I have a tile map and I want to render blood splatters to a set of RenderImages (so the blood splatters remain permanently attatched to the walls). They RenderImages are created dynamically, but the game pauses for about 1- 2 seconds every time I call .create (the dimensions are 128 x 128, so it is not that much). When not created dynamically, it takes my machine like 5 minutes to create enough textures for the entire map. What could be causing it to create the textures so extremely slowly?

Code: [Select]
// Check to see if must create a new texture (texture already in place has no dimensions)
if(pImg->GetWidth() == 0)
{
pImg->Create(128, 128, false);
pImg->Clear(sf::Color(0, 0, 0, 0));
}

245
Graphics / sf::Text not rendering properly
« on: May 10, 2011, 01:18:44 am »
Yup, that worked. Thanks for the help!

246
Graphics / sf::Text not rendering properly
« on: May 08, 2011, 10:14:32 pm »
It doesn't do it with just the default font, it happens with all fonts.
Before I upgraded to the latest Catalyst, I had Catalyst 9.7 and it didn't work either.

247
Graphics / sf::Text not rendering properly
« on: May 08, 2011, 08:19:34 pm »
I read somewhere that when using both plain OpenGL functions in a mix with the SFML ones that the only way to preserve the OpenGL states was to use those functions found in the Renderer class. I could do it with plain OpenGL commands, such as glPushAttribute, but using the Renderer class seemed easier. :)

I upgraded my catalyst to the latest version, but it still crashes when the window closes. The call stack trace brings me to a different line than before for some reason, but it is still in the OpenGL device context class.

248
Graphics / sf::Text not rendering properly
« on: May 08, 2011, 06:47:42 pm »
Argh! I made a little test program to narrow down the problem, but the application crashes on exit with the following code (I am using the exact same library versions as in my game):

Code: [Select]
#include <SFML\Window.hpp>
#include <SFML\OpenGL.hpp>
#include <SFML\Graphics.hpp>
#include <string>
 
int main(int argc, char* args[])
{
sf::RenderWindow appWindow;
sf::Renderer appRenderer(appWindow);

// Create a settings description struct
sf::ContextSettings settings;

// Settings for app window
settings.AntialiasingLevel = 4;

// Create the app window
appWindow.Create(sf::VideoMode(800, 600, 32), "SFML Text", sf::Style::Close, settings);

// Enable Smooth Shading
glShadeModel(GL_SMOOTH);

// Black Background
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

// Depth Buffer Setup
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);

// Really Nice Perspective Calculations
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

// Resize perspective to fit screen aspect ratio
glViewport(0, 0, 800, 600);

// Enable alpha rendering (transparency) in textures
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

// Enable alpha blending
glEnable(GL_BLEND);

// Enable texture mapping
glEnable(GL_TEXTURE_2D);

// Enable backface culling
glEnable(GL_CULL_FACE);

if(glGetError() != GL_NO_ERROR)
abort();

// Additional settings
appWindow.SetFramerateLimit(60);
appWindow.EnableVerticalSync(true);

const sf::Input &inpt(appWindow.GetInput());

sf::Text t;
t.SetFont(sf::Font::GetDefaultFont());
t.SetString("bla bla bla");

sf::Event e;
bool quit = false;

while(!quit)
{
while(appWindow.GetEvent(e))
{
// Window closed
if (e.Type == sf::Event::Closed)
quit = true;
}

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glColor4f(0.3f, 0.5f, 0.3f, 1.0f);

glBegin(GL_QUADS);
glVertex2f(10.0f, 0.0f);
glVertex2f(10.0f, 10.0f);
glVertex2f(0.0f, 10.0f);
glVertex2f(0.0f, 0.0f);
glEnd();

appRenderer.SaveGLStates();
appWindow.Draw(t);
appRenderer.RestoreGLStates();
appWindow.Display();
}

appWindow.Close();
 
    return EXIT_SUCCESS;
}


It doesn't crash on exit if I remove the line containing the
Code: [Select]
appWindow.Draw(t); call.

What is going on here?

249
Graphics / sf::Text not rendering properly
« on: May 08, 2011, 04:08:11 pm »
Hello,

I have created a game using SFML and OpenGL directly, and I wanted to display the script console in the game. However, when I try to render the text, it either uses the previously bound texture (if textures are enabled) or just renders the polygon on which the character is supposed to appear with a solid colored background (textures disabled). In order to mix the SFML OpenGL implementation and my own, I used the sf::RenderTarget functions SaveGLStates and RestoreGLStates to preserve the OpenGL state. The code show below gives me textured boxes instead of text:

Code: [Select]
// Render text
text.SetFont(sf::Font::GetDefaultFont());
text.SetString("bla bla bla");
text.SetColor(sf::Color(18, 128, 34));
text.SetStyle(sf::Text::Regular);

appRenderer.SaveGLStates();
appWindow.Draw(text);
appRenderer.RestoreGLStates();


What could be causing this problem?

250
SFML projects / Gore Factor SFML
« on: April 24, 2011, 05:40:54 pm »
I got around to trying the SFML light manager code Groogy suggested, I had to change some stuff in order to get it to work with the newer versions of SFML 2, but it gives me a memory access violation when closing (specifically, when destroying the OpenGL context). It runs fine until I try to close it. Is this possibly related to the ATI issue? I had that as well but the newer SFML 2 versions seem to have fixed this. Also, this system only supports hard shadows like mine, so right now I don't see why I would use it. Still, I would like to know what is going on.

The only line of code I had to change was:

Code: [Select]
BlurEffect.SetTexture("texture", sf::Shader::CurrentTexture);

To:

Code: [Select]
BlurEffect.SetCurrentTexture("texture");

Which I doubt could have caused this error.

Any ideas?

251
SFML projects / Gore Factor SFML
« on: April 19, 2011, 11:19:06 pm »
It is written in C++ with VS2010 but also uses Lua for some stuff.

The player is a single body shaped sort of like a capsule except that the bottom is pointy and is always kept upright. The friction on the body was removed, since it would drag the crates with it when walking on them, and instead the deceleration is handled manually.

252
SFML projects / Gore Factor SFML
« on: April 15, 2011, 02:58:04 am »
To see whether or not he can jump, I did 2 things:

First, I used the TestPoint function to see if a point directly below the player is touching anything (by parsing all the bodies and hit testing to them). If it is, the player can jump.

Secondly, in the case that the player is somehow stuck in a way where that point is not touching anything, I made it check to see if the vertical velocity is zero and the vertical velocity the last frame was negative (not at the top of a jump). Then you can jump as well.

253
SFML projects / Gore Factor SFML
« on: April 13, 2011, 11:28:38 pm »
Hello everybody,

Here is a project I am currently working on that uses SFML for window handling, sound, and some rendering stuff.

It is a remake of the game "Thing Thing" by Diseased Productions (flash).

So far, all you can do is run around the map and shoot stuff with your trusty AR.

Features:
- 2D Dynamic Shadows
- Box2D physics
- Compound vector/sprite and frame independent animations
- Water
- Lua Scripting
- Quad Tree Scene Graph



Download link: https://sourceforge.net/projects/gorefactorsfml/
VS2010 Redistributable Package REQUIRED: http://www.microsoft.com/downloads/en/details.aspx?familyid=A7B7A05E-6DE6-4D3A-A423-37BF0912DB84&displaylang=en

YouTube Video:



Controls:
- Mouse to aim, click to shoot.
- Move with WASD.
- Reload with R.
- Hold space for slow motion
- Shift + ~ to open the Lua command console

254
General / Startup Error
« on: April 08, 2011, 11:38:42 pm »
Never mind, I found the issue... I was using the x64 external library .dll's, not the x86 ones.

Thanks for the help though!

255
General / Startup Error
« on: April 08, 2011, 10:18:24 pm »
Hello,

I was able to run the tutorials, but after converting an old SDL project to SFML, I get the error:

Quote
The application was unable to start correctly (0xc000007b). Click
OK to close the application.


when trying to run the program. I am using SFML 2 in VS2010, and I did recompile the library. Again, it worked for the tutorials.

Any ideas what may be the cause of this?

Pages: 1 ... 15 16 [17] 18
anything