Jump to content
  • Advertisement

RaptorZero

Member
  • Content Count

    159
  • Joined

  • Last visited

Community Reputation

152 Neutral

About RaptorZero

  • Rank
    Member
  1. Quote:Original post by huaner hi: when I write like this : const char *buf = "print("hello, world!")"; lua_dostring(luaVM, buf); it will hint hello and world are not be declared.but if I replace double quotation with single quotation ,it's right. I remember we can use double quotation in the file of lua when we use the function of print,why this is wrong? thank you very much! When you write that then the second double quotation (just after the opening parenthesis) closes the first one (so the string will be only "print(" ) and anything after that is rubbish. If you write: const char *buf = "print('hello, world!')"; then it will all be OK because the double quotations will surround the print call entirely and the single quotations will surround only the string inside Lua. BTW: single quotes can only surround a string in Lua, not in C/C++ so this would be illegal: const char *buf = 'print("hello, world!")'; Hope that helps!
  2. RaptorZero

    terrain editing

    There seems to be a little misunderstanding between us.. Rendering the texture off-screen to get it's data isn't a very good way of doing it. What I said before is that it's better to already have a copy of that image sitting at some corner waiting to get modifyed and then sent again to OpenGL. The idea here is that instead of getting the texture from OpenGL to change a value and send it again, you always send the new values as if they were a brand new texture. Here's what I meant: -> Create the texture (load from file? whatever) * At this point you should have an array of bytes representing the image -> Copy this array to some place to keep it safe -> Do all the fancy stuff needed to have this texture ready to be used (glGenTextures, glTexImage2D, etc) ... continue happily * User has clicked somewhere corresponding to the pixel (134,450) of that texture -> Get that array of bytes you've kept safe, it should be a big sequence of 'char' values like: {red, green, blue, alpha, red, green, blue, ...} -> The start of pixel (134,450) corresponds to the index --- (450 * imageHeight + 134) * 4 --- of the array. As alpha should be the 4th value of a pixel, add 3 to this index and you have the alpha value (so, assuming you are using something like C it should be: theArrayYouSaved[((pointY * imageHeight + pointX) * 4) + 3]) * You can now change this value -> Resend this 'new' texture to OpenGL as I said in my previous post (it should be similar to what at the beginning) ... continue happily again Hope that helps... if you want any further information about any of those steps just ask! EDIT: Thank you Dancil_Fool [Edited by - RaptorZero on December 1, 2006 8:26:27 PM]
  3. RaptorZero

    terrain editing

    I believe the best way to do that is having a copy of the image in memory (do not delete it after creating the OpenGL texture, keep it somewhere) and then modifying this image and 'uploading' it back to GL via glTexSubImage2D. Keep in mind that if your texture uses mipmaps you'll have to generate them again after the modification (just forget about glTexSubImage2D and do what you did to load it before - you can do it without calling glGenTextures again this time). Hope that helped.
  4. RaptorZero

    terrain editing

    I THINK his question is about changing the values of a texture that has been already loaded, put inside the graphics API, binded and is being used... but I'm not certain about it. if(mySupposition == true) Are you using OpenGL or Direct3D? else Please explain better ;)
  5. RaptorZero

    C++ template class (solved)

    My complaint about including a cpp was because of having to remove the 'compile' and 'link' options for it inside the IDE, what is kind of a hack. It seems the templates mechanics makes more sense now, thanks for the explanation.
  6. RaptorZero

    C++ template class (solved)

    Really strange but it works, thanks a lot! Damn compiler forcing me to include a cpp file...
  7. [solved] Ok guys, it seems I'm having trouble with a template class even after some hours trying to make it work. I've been able to simplify the code to a few lines that still gives me the same error so here it goes: foo.h template<class T> class Foo { public: void F(void); }; foo.cpp #include "foo.h" template<class T> void Foo<T>::F(void) { return; } main.cpp #include "foo.h" int main(void) { Foo<int> A; A.F(); return 0; } Judging by the simplicity of the code I think it might be a really stupid mistake so be nice to me (I've tryied, believe me). The problem is the compiler (MSVC Toolkit 2003) gives me an 'unresolved external symbol' for that function F used in main. Any help is appreciated, thanks! [Edited by - RaptorZero on October 21, 2006 6:23:41 PM]
  8. RaptorZero

    Milkshape Animation Tutorial?

    How about this: http://rsn.gamedev.net/tutorials/ms3danim.asp Good luck!
  9. RaptorZero

    svchost.exe is cancer

    I know you've already run a anti-virus test but a good start would be to make sure this svchost.exe intance is located in it's expected folder (system32?) This page has some info about that process: http://www.neuber.com/taskmanager/process/svchost.exe.html
  10. RaptorZero

    [.net] Which IDE Do You Use?

    I wounder if VS 2005 has a good performance. I remember some time ago I tried the Beta 1 and it was really heavy, using 400Mb+ of memory and frequently consuming 100% CPU time under normal operation. I use Code::Blocks for C/C++ because it's really light and clean. I don't think don't know if it supports C#.
  11. RaptorZero

    Please help with windows basics

    It depends on what language you are using. If you are using C++ this is a good place to start: http://www.cplusplus.com/doc/tutorial/basic_io.html If you are using C then you should see this: http://www.cprogramming.com/tutorial/c/lesson1.html If you aren't using either then post the one you're using. Hope that helps.
  12. RaptorZero

    This is gone past Iraq

    Oh god, it seems that things got even worse... Victims number got to 86 this morning, 66 buses were burned and about 1/3 of all the buses of the city (one of the biggests in the world!) are out of circulation leaving people by foot, 10 bank agencies were attacked and the elite troops are ready to go to the streets. (these numbers vary a little from site to site) I don't see any quick solution for the situation. Thanks god these things are restricted to São Paulo. Here things are as usual.
  13. RaptorZero

    This is gone past Iraq

    Some pictures Picture 1 Picture 2 Picture 3 Picture 4 Picture 5 Picture 6 Picture 7 Picture 8 Picture 9 Picture 10
  14. RaptorZero

    This is gone past Iraq

    Quote:Original post by Run_The_Shadows You're comparing a localized area to an entire country So, does that means that the localized area is as bad as a whole country? The 'localized area' contains the most important city in this country, and it's easy to say it's not bad when you're far from it. And as I said before the comparison is between the headlines not at every point of the situations.
  15. RaptorZero

    This is gone past Iraq

    Attacks are targeted to police officers but that doesn't mean it's less shocking. Both situations are different but can be easily compared, and a comparison between Iraq (a recent war zone) and São Paulo is very sad. Numbers: 100 attacks: 35 police officers, 3 civilians and 14 attackers dead 44 rebellions in the state's prisions (this number got to 69 counting the ones that were controlled) 9 buses were burned PS: these killings are all in the São Paulo state wich has a population of 40 million, so it's 1.3 dead per million wich is more than iraq.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!