I've been trying to find a good c++ tutorial on Parallax techniques but have been unable to locate anything particular helpful, I was just wondering if anyone knew some where were I could find some of tutorials or had some sort of sample code to give me an idea of how to incorporate it into c++
1) split your display into "layers"
2) assign each layer a scale (ie: 2.0 would scroll twice as fast, 0.5 would scroll half as fast)
3) draw each layer separately
4) When drawing a layer, multiply the current overall scroll by the layer's 'scale'
5) enjoy your new, fancy, paralax scrolling.
EDIT:
You can get even fancier and have layers "auto scroll" by giving each layer a scroll offset and an autoscroll rate. Just add the autoscroll rate to the offset every update, then draw at (main_scroll + scroll_offset) * scale.
To me it looks like you are drawing the same image twice, so that doesn't seem right to me.
Also, any particular reason why you're mixing direct OpenGL calls with SFML sprite drawing calls? IIRC SFML will muck up the OpenGL state... so if you're going to do this, you will need to surround your OpenGL code with some SFML state save/restoring code. I forget exactly how to do it, as it's been a while.
Also you are pushing/popping the matrixes, but not modifying them....
Ah the first one news it and tells it were to find the file and what type it is
second one calls the draw code
Yeah i have noticed some of my stuff has been screwed with since this code..i;m working in a group assignment and one of my team mates made a sprite and texture class were i get my m_psprite from but he told me i could this GL stuff with it >.< i guess he was wrong =D
Ha I accidently removed my modifying code sigh
Ill google around how to save The sfml state stuff