graphics issues

mkay, before i start posting my problems and walls of code, this is more a direct3d related issue than just a c++ related issue, would this be the right place to post it or should i just turn around now? It is indeed written in c++.
There is nothing wrong with posting direct3d problems here. Though it seems to me that there aren't too many here experienced with directx. Do make your post.
well shoot, the problem is, i'm also not too experienced in d3d, but here goes.

through basic tutorials and bits of code i have found across the internet, i have patched together a very simple engine with a few objects, and i have finally managed to get things rendering on the screen in a relatively organized fashion, with some minor input, etc. however, everything was going relatively bug free until i turned on the lights, so to speak. when i made the light class and added materials functions to the object class, all the objects i make with materials have a nasty flickering, and i can't find the culprit. I was hoping if i posted my code in a forum somewhere, someone might be able to find it better than I.

Also, my second problem, the functions in the object involving indexed objects like cubes simply don't work and don't even seem to attempt to work. If anyone with more experience can find my error somewhere, or even just see little things i can do for optimization or cleaner code, i'll be greatly appreciative. And if not, that's also perfectly fine, thank you for trying :P.

You'll be finding little tidbits of code where i was testing and learning stuff so ignore the nasty and unused stuff.
Last edited on
-edit-
Last edited on
-edit-
Last edited on
-edit-
Last edited on
That should be it. btw, if these look similar to something you've seen before, alot of it has been copied and altered from a project i found by a guy online who's name was something like Ivan Noise or Moise or something, sorry, i've long since deleted his comments and headers, but just for the record, i don't "claim" the rights to any of this code.

Anyway, to elaborate, the issue i'm having with the lights is just a flickering of the material. Like every movement of the camera cause it to seemingly flicker the light setting on and off, where the triangle is pure white for split seconds while moving the camera. normal colored vertex objects without the lights on render just fine, without a hitch.
Last edited on
oh god. do you call that 'avoiding walls of code' ? :)
Tip: when you have lots and lots of code, put in in pastebin, so hat it doesn't look so scary.

It would be very hard to find a bug in all this code by just reading it. Post all of it (a compilabe ammount that exhibits the problem) (either in pastebin, or upload your files in madiafire or etc. )...
yeh i was afraid of that :P. lemme see if i might be able to put it all into a manageable zip file.
k there you go. deleted all the above code for cleanliness.

http://www.mediafire.com/?45crer6xkoab2dy

yeh, i realized after looking at what i posted, that i was prolly asking too much. i've spent days now just combing through the individual objects trying to find something that is being redrawn or reset that isn't supposed to, so posting to a forum somewhere is just kinda a desperation move. If you feel this is outside the scope of this forum, i can move it somewhere else if you like.
Last edited on
if your still trying, just an update, in the vbobject file i sent, i broke the indexing functions worse at some point when i was trying to tell it literally what to draw in attempt to diagnose it, so that's the reason it seemingly isn't using the arguments at all. really i'm just trying to find this graphical glitch with the lighting.

Also, the debugging thing looking for keypresses, i just set that up cause for some reason i couldn't get the camera viewport to move, and i was trying to figure out if direct input was even seeing the keypresses at all. Which it wasn't, didn't realize it needed to acquire the device each time it retrieved the keyboard state. my bad, but anyway, you can delete or comment out the #define debugging statement at the top of main.cpp to get rid of it.
Last edited on
Is that the right code? I just now compiled it. I see a white triangle with one of it's corners dark. I see no flickering.. Is there some condition I missed? Did you compile that version before uploading?
sry for totally not posting for two days, work and home issues, what can i say?

anyway, yeah that's all the files i copied directly out of the project folder updated, compiled, and currently unchanged since i havn't had the chance to do any work :P . no when you don't move the camera and just stay in the same place, it renders just fine with the light and everything, but using the wsad keys to move around, the material always starts flickering while moving for me. even when moving you don't have that problem?
Last edited on
Right. Even when I move, I see no flickering.
The only changes I make are commenting out the lines that use Debug object.

I don't think I can help you with this..
Try running your code on a different machine.
Try working out a minimal example which reproduces the error.
Try posting on a different site. I think gamedev has a directx section..
i m beginner in c++ .i know c lang.. some what
1.i want to do pc tp pc fiber optic comm.. for this i have to use serial port so how can i select com port
2.how can i create GUI
my id-vijay.parmar1992@gmail.com
Go make your own thread about it. This is no place to ask about your own unrelated problems.
Topic archived. No new replies allowed.