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

Pages: [1]
1
Graphics / sf::Image from list of sf::Shapes?
« on: June 23, 2011, 01:15:22 am »
Okay that's what I figured.

The graph fills only a part of the RenderWindow when it's drawn, and that's the only thing I want saved to an image file.

Is there a way I can cut down an sf::Image to certain dimensions after calling RederWindow.Capture?  Otherwise, I tried sf::Image.CopyScreen(RW, sf::IntRect) but the screenshot is mirrored.

2
Graphics / sf::Image from list of sf::Shapes?
« on: June 22, 2011, 12:47:44 am »
Hey everyone.

The project I'm currently working on generates a graph.  It creates an std::vector of sf::Shapes that represent the plots, grid, etc...

I want to be able to export this list of shapes to a file.  I know that Image.SaveToFile can do this with images, but is there a way to combine all of my shapes into one sf::Image?

3
Graphics / Sprites being draw to world coordinates instead of screen
« on: March 01, 2011, 01:08:26 am »
window.PreserveOpenGLStates seemed to work.  Is this because PreserveOpenGLStates works differently for mac than it does for linux?  I don't know why I didn't think about that...

Thanks for the help Laurent.

4
Graphics / Sprites being draw to world coordinates instead of screen
« on: February 28, 2011, 05:47:31 pm »
I am using both SFML (window, system, and graphics) and OpenGl. SFML for the windowing/menu and opengl for rendering the scene.  I can't really provide a small working example because the whole project is pretty split up.

Currently all I use opengl for is displaying a bunch of cubes:
Code: [Select]
void drawScene(){
  glBegin(GL_QUADS);
  {
    glVertex3f(...);
  ...
  }
}


I use shapes/sprites to draw the menu (this is just the background, but other parts are made similarly):
Code: [Select]
void createMenu(){
  sf::Shape fileMenuBackground;
  ...
}


Before and after I draw the menu (after I draw the scene of openGL cubes) I call these two functions:

Code: [Select]
void preSFML(){
glMatrixMode(GL_MODELVIEW);  glPushMatrix();
glMatrixMode(GL_PROJECTION); glPushMatrix();
glPushAttrib(GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT   | GL_ENABLE_BIT  |
GL_TEXTURE_BIT | GL_TRANSFORM_BIT | GL_VIEWPORT_BIT);

glDisable(GL_ALPHA_TEST);
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
}


Code: [Select]
void Gui::postSFML(){

glMatrixMode(GL_PROJECTION); glPopMatrix();
glMatrixMode(GL_MODELVIEW);  glPopMatrix();
glPopAttrib();
}


So it looks something like this:

Code: [Select]
drawScene();
preSFML();
     App->Draw(fileMenuBackground);
     ...
postSFML();


All of this runs just fine in linux.  The menu is properly drawn to the 2D screen coordinates and the cubes drawn to the 3D scene coordinates.  When I run this program on a mac, both the menu and the cubes are drawn to the 3D scene coordinates.  Hopefully this illustrates my problem a little bit better.  I am probably just be doing something wrong or have a misconception on how openGL works.  

What I was asking in my first post is if there is a known issue of why the menu is being drawn to the 3D coordinates.  Is there something I'm doing in the preSFML and postSFML functions that does not work properly on a mac?  Possibly anything else?  I appreciate the help.

5
Graphics / Sprites being draw to world coordinates instead of screen
« on: February 25, 2011, 11:39:13 pm »
I am working on a project that is used on both Macs and Linux machines.  

In linux, the program runs just fine.  I have a few sprites for a menu that are mapped to the screen coordinates and shows up correctly.  On a mac, this same program maps the sprites to the world coordinates instead of the screen coordinates, so there is a gigantic menu bar in the 3D space.  I've double checked to make sure I am pushing the gl_projection and gl_modelview matrices before I draw the sprites, and then pop them after (along with the other openGL cleanup stuff).

Is there a known bug or issue that I am not compensating for?  Can anyone point me to information on this problem?

Thanks

6
Graphics / Static sprite size on resize event
« on: January 27, 2011, 12:11:41 am »
Nice, that did the trick!  Thank you.

Here's the code I added:

Code: [Select]

static sf::View view;
sf::FloatRect rect(0, 0, newWidth, newHeight);
view.SetFromRect(rect);
App.SetView(view);


7
Graphics / Static sprite size on resize event
« on: January 26, 2011, 11:38:07 pm »
On Event::Resized (when someone clicks and drags the corner of the App window to be smaller/larger) all of my sprites and shapes get smaller/larger respectively.  Is there a way that I can disable this from happening?  I'm running an OpenGL visualization with sprites that make up my menu.

My code is a bit intricate to post right now, but later I can put together an example to better illustrate my question.  Thanks for the help.

Pages: [1]
anything