• What do you need help with? Version 1
    5,001 replies, posted
Does it look like this now? [img]http://www.imgdumper.nl/uploads3/4c1fabbaa5820/4c1fabba998b1-darwinapp.png[/img]
It was supposed to, that was the example I was trying to duplicate with Tao, but as I said, I changed the drawing code. [IMG]http://j.imagehost.org/0070/Capture_9.jpg[/IMG] That line is fixed to the center and points in the Y direction. I don't know yet how to make it display behind the triangle since it's now always on top but I think that's not very simple.
Could you post your code? It looks like you didn't enable the Z buffer.
O.O I just enabled DEPTH_TEST and it works. That was suspiciously easy. Thanks for the tip.
What is the best way to "transform" my c++ console program into a GUI(net framework)?
Well, instead of feeding console input into it, feed the input from your GUI controls to it. Same with the output. I think you phrased that question too general, as what's in those sentences up there is already known to you.
Well i've tried just copying the files from my console project onto a new windows forms project and set it up accordingly, but it doesn't work. [code]error C2872: 'Runtime' : ambiguous symbol[/code] Should i post runtime.cpp?
Yeah.
[QUOTE=ZeekyHBomb;22779655]Yeah.[/QUOTE] [lua]#include "stdafx.h" #include <iostream> #include <conio.h> #include "runtime.h" #include "mouse.h" #include <iostream> #define FPS 10 #define SPEED 1000/FPS double currentTime = 0; bool Runtime::start(void) { char key = ' '; Mouse mouse = mouse; startTime = timeGetTime(); frameCount = 0; lastTime = 0; int clicks = 0; bool R_Toggle = false; bool L_Toggle = false; while(key != 'c') { while(!getInput(&key)) { if((GetAsyncKeyState(0x51)) && (GetAsyncKeyState(VK_LCONTROL)) & 0x8000) // CTRL+Q = Left Click { mouse.mouseClick_L(); clicks++; std::cout << "**LEFT CLICK**" << std::endl; // Debug Sleep(100); } if((GetAsyncKeyState(0x45)) && (GetAsyncKeyState(VK_LCONTROL)) & 0x8000) // CTRL+E = Left Click { mouse.mouseClick_R(); clicks++; std::cout << "**RIGHT CLICK**" << std::endl; // Debug Sleep(100); } if((GetAsyncKeyState(0x51)) && (GetAsyncKeyState(VK_LSHIFT)) & 0x8000) // Shift+Q = Enable Auto Left Click { std::cout << "Toggling left button on" << std::endl; L_Toggle = true; while(L_Toggle) { if((GetAsyncKeyState(0x51)) && (GetAsyncKeyState(VK_LMENU)) & 0x8000) // Alt+Q = Disable Auto Left Click { L_Toggle = false; } mouse.mouseClick_L(); std::cout << "**LEFT CLICK**\n"; // Debug clicks++; Sleep(100); } std::cout << "Toggling left button off" << std::endl; } if((GetAsyncKeyState(0x45)) && (GetAsyncKeyState(VK_LSHIFT)) & 0x8000) // Shift+E = Enable Auto Right Click { std::cout << "Toggling right button on" << std::endl; R_Toggle = true; while(R_Toggle) { if((GetAsyncKeyState(0x45)) && (GetAsyncKeyState(VK_LMENU)) & 0x8000) // Alt+E = Disable Auto Right Click { R_Toggle = false; } mouse.mouseClick_R(); std::cout << "**RIGHT CLICK**\n"; // Debug clicks++; Sleep(100); } std::cout << "Toggling right button off" << std::endl; } timerUpdate(); } } //std::cout << "Your FPS was: " << frameCount / ((timeGetTime() - startTime) / 1000) << std::endl; // Debug std::cout << "\nYou auto-clicked " << clicks << " times." << std::endl; return true; } bool Runtime::getInput(char *c) { if(_kbhit()) { *c = _getch(); return true; } return false; } void Runtime::timerUpdate(void) { currentTime = timeGetTime() - lastTime; if(currentTime < SPEED) return; frameCount++; Sleep(25); //Wait for 25ms before updating again lastTime = timeGetTime(); }[/lua] Header [lua]#ifndef RUNTIME_H #define RUNTIME_H class Runtime { public: bool start(void); protected: bool getInput(char *c); void timerUpdate(void); private: double frameCount; double startTime; double lastTime; }; #endif[/lua]
I too can't see why it should be ambiguous. You could try with ::Runtime each time.
[QUOTE=ZeekyHBomb;22779931]I too can't see why it should be ambiguous. You could try with ::Runtime each time.[/QUOTE] error C2352: 'Runtime::start' : illegal call of non-static member function :saddowns:
These errors are in the runtime.cpp file, or in the file using the Runtime class?
Is it true that OpenGL only allows 8 light sources? What about corridors filled with torches or something, how is that done?
The allowed minimum is 8. To see how many are available, use glGet(GL_MAX_LIGHTS);. But all the cool kids use the programmable pipeline today.
[QUOTE=ZeekyHBomb;22781452]The allowed minimum is 8. To see how many are available, use glGet(GL_MAX_LIGHTS);. But all the cool kids use the programmable pipeline today.[/QUOTE] Eg. Infinite lights, you just gotta write some shaders.
[QUOTE=ZeekyHBomb;22780790]These errors are in the runtime.cpp file, or in the file using the Runtime class?[/QUOTE] The file using it
Then I guess you're up to this: [url]http://www.cplusplus.com/doc/tutorial/classes/[/url]
[QUOTE=Darwin226;22780913]Is it true that OpenGL only allows 8 light sources? What about corridors filled with torches or something, how is that done?[/QUOTE] Yeah, the maximum is 8 lights per pass. Same on DirectX. If you want to have more, you either go with shaders, or you go multi-pass.
[QUOTE=esalaka;22781557]Eg. Infinite lights, you just gotta write some shaders.[/QUOTE] To further elaborate on this, the old "immediate mode" system is now frowned upon: instead of using the built in lighting system, you should write a pixel shader following something like the Blinn-Phong (google it) in order to use more lights. You should also write your own vertex shader to handle projection and transformation, and use Vertex Buffer Objects (or Vertex Arrays as a minimum), as opposed to OpenGls matrix methods, and the glBegin/glEnd methods. You should probably get an up to date book on it :)
Should you be using VBO for models nowadays or are display lists still the way to go for absolutely static geometry like models?
[QUOTE=Overv;22784406]Should you be using VBO for models nowadays or are display lists still the way to go for absolutely static geometry like models?[/QUOTE] He should be using VBOs.
Awesome, why?
Why isn't this compiling? :saddowns: [cpp] #include <stdio.h> #include <Windows.h> int main() { TCHAR buff[1024]; GetLogicalDriveStrings(1024, buff); int i; for(i = 0; buff[i] != 0; i += 4) printf("%S", buff+i); } [/cpp] [img]http://ahb.me/5T-[/img]
what's up with that Windows.h with a capital W?
[QUOTE=shill le 2nd;22788083]what's up with that Windows.h with a capital W?[/QUOTE] intellisense does that iirc
[QUOTE=TheBoff;22783772]To further elaborate on this, the old "immediate mode" system is now frowned upon: instead of using the built in lighting system, you should write a pixel shader following something like the Blinn-Phong (google it) in order to use more lights. You should also write your own vertex shader to handle projection and transformation, and use Vertex Buffer Objects (or Vertex Arrays as a minimum), as opposed to OpenGls matrix methods, and the glBegin/glEnd methods. You should probably get an up to date book on it :)[/QUOTE] To further further elaborate on this, OpenGL 3.0 deprecates all immediate mode and fixed function pipeline functionality, and 3.1 removes it all to an extension. So it's not only frowned upon these days, it's not even sure to be there in newer implementations. However in order to support cards not capable of GL3, you can still use of course older versions of GL, the obvious choice being 2.1, but only making use of the forward compatible subset. You miss out on pretty features of 3+ like proper hardware instancing, but you gain support for older cards. (I think 3.0 support comes into the nvidia line about the 8 series)
I'm just starting reading up on C++, going to be my first language besides very little HTML and javascript. What compiler should I be using, and what do I do with the cpp file? I was messing around with visual basic 2010 but I gave up so I'm here
[QUOTE=Atrbfs;22789629]What compiler should I be using, and what do I do with the cpp file? I was messing around with visual basic 2010 but I gave up so I'm here[/QUOTE] You gave up on VB so you've decided to try C++? Dear god....
I can always try it again, I sure wasnt sure how to compile it or whatever :( was trying to pull [url]http://cplusplus.com/doc/tutorial/program_structure/[/url] together but I didnt know how to compile, that's what I need to know. Maybe I should look at python and forget this for now.
[QUOTE=Atrbfs;22789629]I'm just starting reading up on C++, going to be my first language besides very little HTML and javascript. What compiler should I be using, and what do I do with the cpp file? I was messing around with visual basic 2010 but I gave up so I'm here[/QUOTE] You gave on VB.. an easy language... and tried to learn c++? a hard langauge? :geno:
Sorry, you need to Log In to post a reply to this thread.