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

Pages: [1]
1
Graphics / Re: Checking an sf::image vector
« on: January 02, 2013, 11:39:12 am »
And I feel real dumb 2 hours later when I realize the sf::Image is only needed for the loading process.
So I only needed one sf::Image to begin with and after all textures are loaded with handles it is pointless as well.

2
Graphics / Re: Checking an sf::image vector
« on: January 02, 2013, 09:29:31 am »
Quote
Having an empty vector will not cause any problems.

Cool I did not know if that was true.  Since I had never been told so before I just avoided ever having an empty vector in any program as it seemed undefined which is where most bugs seem to come from.


3
Graphics / Re: Checking an sf::image vector
« on: January 02, 2013, 09:18:10 am »
Well I initialize everything in a constructor including vector sizes being set to 1, to prevent undefined behavior.  So the first time I add a texture then the Image vector data position 0 is empty so I just load the image.  The second time I call it I need to expand and then load and bind textures.. 

Maybe code would be more clear than words subject to interpretation:
void TextureManager::AddTexture(std::string FileName){
  if(Birthing)
    Birthing = false;
  else
    Expand();
  int x = NumberOfTextures-1;
  Textures[x].LoadFromFile(FileName);
  glGenTextures(1, &TextureID[x]);
  glBindTexture(GL_TEXTURE_2D, TextureID[x]);
  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Textures[x].GetWidth(), Textures[x].GetHeight(),
               0, GL_RGBA, GL_UNSIGNED_BYTE, Textures[x].GetPixelsPtr());
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}
 

4
Graphics / Re: Checking an sf::image vector
« on: January 02, 2013, 08:21:12 am »
Well obviously no images are loaded after the class is constructed unless I provide a filename as an argument in its construction (which I have not) so I wondered if I could test the vector for this initialization condition so that I didn't leave the first data position open and I didn't want to leave the last one empty either so the best way to keep the vector to the exact size of the number of textures was to just do a quick test to see if the vector[vector.size()-1] was loaded.  If there is no functionality for this I could also use a boolean in the class that was set to true on initiation and then set as false after the first load, but if there was built in functionality for this test I would be wasting memory by doing so. 

  So I asked ;o).  I'm am guessing by your answer there is no such functionality so I will revert to my other solution to the problem.  Thanks, and I do like the library you have developed so far.
 

5
Graphics / Checking an sf::image vector
« on: January 02, 2013, 08:06:13 am »
Hey!

   I am writing a texture manager that uses the sf::Image to load its textures.  I have a vector of images that will be used as I know each project will have a varying number of Textures.  I also have a GLuint vector that communicates the textures back to Open GL. Basicly I want the AddTexture(string FileName) function to be able to tell if the last data position in the vector has an image stored in it.  If there is already an image loaded then I wanted it expand both vectors by one and load the new image and bind the new texture.

   Most of the logic is already done I just couldn't easily find a way to test a given sf::Image and see if it already had a loaded file.  Sorry if the answer is somewhere obvious I have been looking for a while, and will continue to do so even after I post this.  :o)

Thanx for your time and happy new years to all!

6
Graphics / Re: libGLEW.so.1.5 no found
« on: January 01, 2013, 07:54:03 am »
well it turns out that just installing the package as you suggested worked... I had just wanted to get the most up to date version and I'm sure I did something stupid along the way and shot myself in the foot.  At least you were able to follow the blood trail and help me back out alive ;o).

Thanks again.

7
Graphics / Re: libGLEW.so.1.5 no found
« on: January 01, 2013, 05:24:46 am »
Well there was no install file and all the includes seem to be intact, but I will take your word for it.  I am stuck @ work tonight, but I will post back the results when I get back to my laptop.

8
Graphics / Re: libGLEW.so.1.5 no found
« on: January 01, 2013, 04:24:45 am »
I tried the sudo apt-get I don't think it is listed as a package for ubuntu 12.10 x64 bit.  So I installed all the individual packages and extracted the files from version 2.0 tried to send it to usr/include but it told me I didn't have the privledges so.  I extracted to a dif folder then I used

sudo mv SFML/ /usr/include

I did the same with the lib folder.  I did not with the share folder as it looked like only documents (maybe I should have?)

Then g++ was finally finding all the folders and libraries and that's when the message came up about GLEW.so1.5.  I knew it was downloaded so I went to the directory it was looking in and found 1.8 that was where I figured it wasn't compiled to use 1.8 but I wanted to ask since I figured someone here had gone through this before.

Before u say it I know I am prob retarded about how I did some of it, but I am new to Unix (1 month) and I like it but I still have trouble finding my way around the OS.

9
Graphics / Re: libGLEW.so.1.5 no found
« on: January 01, 2013, 02:58:44 am »
I am probably even less of an expert as I have spent way to much time trying to get this library to build.  I just started using ubuntu last month so very new to Unix.

I will try to get the older packages installed on my machine after work.  Are you sure this isn't going to create problems in my system to have old and new GLEW files?

I downloaded the 64 bit 2.0 version of SFML.

10
Graphics / libGLEW.so.1.5 no found
« on: December 31, 2012, 10:22:08 pm »
Hey!

   I've tried SDL, Win32, and GLUT, with OpenGL and I just found out about SFML yesterday.  I figured I'd give it a try because I prefer to program in C++.  I have had some bumps along the way getting things to work.  I'm still trying to compile the first example program in your tutorial and I hit a wall on this error.

warning: libGLEW.so.1.5 needed by (blah blah path) graphics.so

I have libGLEW.so.1.8 on my system is this causing the problem?

Thanks for any and all help!

Pages: [1]