1. Post #3601
    Stonecycle's Avatar
    September 2011
    3,281 Posts
    To get a number from a JTextField, I suggest adding an ActionListener to it, just like you would to a JButton. Keep in mind that this requires pressing Enter.
    If you wish to convert as soon as the user stops typing, a clean way of doing this would be adding a FocusListener to the text field and implementing the focusLost method to call the conversion method. This will convert the units when the text field component loses focus (e.g. when you click on something else).

    As far as the combo boxes go, they also work with ActionListeners — whenever a user selects an option, the listener is triggered. This, of course, means that you can do something along the lines of this:
    Got the JComboBox updater working, but now it's not executing the method f2c. Enumerators are out of the question due to class assignment. Been working on it since last week and it's due tomorrow sometime and all that.

    package tempconv;
    
    import javax.swing.*;
    import java.awt.event.*;
    
    public class Tempconv {
      //  FAHRENHEIT
      static double f2c(double temp)  {	  //  Fahrenheit/Imperial to Celsius/Metric (°F-°C)
    	return (5/9)*(temp-32);	}
      
      static double f2k(double temp)  {	  //  Fahrenheit/Imperial to Kelvin (°F-°K)
    	return (temp + 459.67) * (5/9);	}
      //  CENTIGRADES
      static double c2f(double temp)  {	  // Celsius/Metric to Fahrenheit/Imperial (°C-°F)
    	return temp * (9/5) + 32; }
      
      static double c2k(double temp) {	  //  Celsius/Metric to Kelvin (°C-°K)
    	return temp+273.15;	}
      //  KELVIN
      static double k2f(double temp)  {	  //  Kelvin to Fahrenheit/Imperial (°K-°F)
    	return temp * (9/5) - 459.67; }
      
      static double k2c(double temp)  {	  //  Kelvin to Celsius/Metric (°K-°C)
    	return temp - 273.15; }
    
      
      
      static void check(double temp, String from, String to)  {
    	final ui frame = new ui();
    	if (from.equals("°F") && to.equals("°C")) {
    	  //double buff = Double.parseDouble(frame.txt_Temp.getText());
    	  frame.l_result.setText(Double.toString(f2c(temp)));	  }
      }
      
      public static void main(String[] args) {	
    	//	Let's set up some frame properties here, first.
    	final ui frame = new ui();
    	frame.setVisible(true);
    	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    	frame.setSize(275, 85);
    	frame.setResizable(false);
    	
    	frame.cb_fromunit.addActionListener(new ActionListener()  {
    	  @Override
    	  public void actionPerformed(ActionEvent evt)	{
    		
    	  }
    	  });
    	frame.cb_tounit.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent evt) {
            // Set your unit field or w/e you have to comboBoxUnits.getSelectedItem(), then call the conversion method.
            //	DO WHATEVER on this line, preferrably run temp. conversion
    	  //double temp = Double.parseDouble(frame.txt_Temp.getText());
    	  //frame.l_result.setText(Double.toString(f2c(temp)));
    	  Object from = frame.cb_fromunit.getSelectedItem();
    	  Object to = frame.cb_tounit.getSelectedItem();
    	  check(Double.parseDouble(frame.txt_Temp.getText()), from.toString(), from.toString());
        }
    });
    
    	
    	
      }}
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  2. Post #3602
    Gold Member
    Lexic's Avatar
    March 2009
    5,782 Posts
    When I compile I get thrown a bad_alloc. I think it is either coming from my read function not remembering the char array. can someone help?
    Also when I add 1 to the length of the char array then it doesn't load the file and the program crashes.
    You're using free() on something that's been new[]'d. You have to use delete[].
    Also, since you're using C++ and not C, stop mucking about with the heap unnecessarily.
    How to read a whole ASCII file into a C++ std::string
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  3. Post #3603
    Eh?
    CanadianBill's Avatar
    May 2007
    1,799 Posts
    I have a rather simple (I think) question. I'm trying to understand this code, I've got it all down except the very end "map" function.
    The original code is here: http://grathio.com/2009/11/secret_kn...ing_door_lock/

    Here's the part I don't understand. How does it "normalize it" and just get the tempo rather than the timing?
    Code:
      for (i=0;i<maximumKnocks;i++){ // Normalize the times
        knockReadings[i]= map(knockReadings[i],0, maxKnockInterval, 0, 100);      
        timeDiff = abs(knockReadings[i]-secretCode[i]);
        if (timeDiff > rejectValue){ // Individual value too far out of whack
          return false;
        }
        totaltimeDifferences += timeDiff;
      }
    Thanks!
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  4. Post #3604
    Mozartkugeln's Avatar
    August 2012
    967 Posts
    Code:
        @Override
        public void actionPerformed(ActionEvent evt) {
            // Set your unit field or w/e you have to comboBoxUnits.getSelectedItem(), then call the conversion method.
            //	DO WHATEVER on this line, preferrably run temp. conversion
    	  //double temp = Double.parseDouble(frame.txt_Temp.getText());
    	  //frame.l_result.setText(Double.toString(f2c(temp)));
    	  Object from = frame.cb_fromunit.getSelectedItem();
    	  Object to = frame.cb_tounit.getSelectedItem();
    	  check(Double.parseDouble(frame.txt_Temp.getText()), from.toString(), from.toString());
        }
    You're passing in the same unit twice, i.e. you're converting from one unit to that exact same unit.


    I suggest making temp, from and to private fields so you don't have to constantly pass them into the method as arguments; furthermore, your conversion methods and your check() method should be private as well since you wouldn't need them outside that particular class.
    Reply With Quote Edit / Delete Windows XP Serbia Show Events

  5. Post #3605
    Stonecycle's Avatar
    September 2011
    3,281 Posts
    You're passing in the same unit twice, i.e. you're converting from one unit to that exact same unit.


    I suggest making temp, from and to private fields so you don't have to constantly pass them into the method as arguments; furthermore, your conversion methods and your check() method should be private as well since you wouldn't need them outside that particular class.
    Fixed that stuff after asking that time. Next problem is that the conversions are outputting as 0.0, but it identifies when to go negative. Testing with f2c first.

    static double f2c(double temp)  {	  //  Fahrenheit/Imperial to Celsius/Metric (°F-°C)
    	return ((temp-32) * (5/9));	}
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  6. Post #3606
    Bazkip's Avatar
    July 2011
    3,181 Posts
    I think you just probably need to surround your matches with [].

    Edit: Dear got that was a terrible sentence.
    Oh jesus how did I forget that
    Thanks.

    Still have no idea how to get the " in the regex though, since I can't escape that

    Here's an update of what I've got now
    Dim specialRegex As New Regex("[!%&'*,-./" + Regex.Escape("+*#()$]"))
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  7. Post #3607
    Mozartkugeln's Avatar
    August 2012
    967 Posts
    Code:
    static double f2c(double temp)  {	  //  Fahrenheit/Imperial to Celsius/Metric (°F-°C)
    	return ((temp-32) * (5/9));	}
    5 and 9 are ints, so the / operator makes the quotient an int as well. Replace "5/9" with "5.0/9.0" and you should be good.

    Edited:

    Still have no idea how to get the " in the regex though, since I can't escape that
    Use two quotation marks to escape it. For example, "This is a ""string"" literal" should come out as:
    Code:
    This is a "string" literal
    Reply With Quote Edit / Delete Windows XP Serbia Show Events Useful Useful x 1 (list)

  8. Post #3608

    January 2012
    378 Posts
    Oh jesus how did I forget that
    Thanks.

    Still have no idea how to get the " in the regex though, since I can't escape that

    Here's an update of what I've got now
    Dim specialRegex As New Regex("[!%&'*,-./" + Regex.Escape("+*#()$]"))
    Typically in regex you use back slash to escape characters. so you would put something like "[!%\"]" for your regex. I don't think you need the Regex.Escape part. But I'm not that great with VB
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  9. Post #3609
    Stonecycle's Avatar
    September 2011
    3,281 Posts
    Thank you guys, nearly done (and understanding it a little more), but there's one flaw left: the JLabel l_result is not updating within the check() method, so I placed a test l_result.setText() after. I say it's something wrong within check().

      private static void check(double temp, int from, int to)  {
    
    	formulae f = new formulae();
    	final ui frame = new ui();
    	double save;
    	
    	DecimalFormat tuPoint = new DecimalFormat("0.00");
    	//int fromunit = frame.cb_fromunit.getSelectedIndex();
    	//int tounit = frame.cb_tounit.getSelectedIndex();
    	//	0 for F, 1 for C, 2 for K
    	
    	if (from == 0 && to == 0) {
    	  System.out.printf("Fahrenheit stays at %.2f°F\n", temp);
    	  frame.l_result.setText(Double.toString(temp));}
    	else if (from == 0 && to == 1) {
    	  System.out.printf("Fahrenheit to Celsius, %.2f°C\n", f.f2c(temp));
    	  save = f.f2c(temp); tuPoint.format(save);	temp = save;
    	  frame.l_result.setText(Double.toString(f.f2c(temp)));}
    	else if (from == 0 && to == 2)	{
    	  System.out.printf("Fahrenheit to Kelvin, %.2f°K\n", f.f2k(temp));
    	  frame.l_result.setText(Double.toString(f.f2k(temp)));	}
    	
    	else if (from == 1 && to == 0)	{
    	  System.out.printf("Celsius to Fahrenheit, %.2f\n", f.c2f(temp));
    	  //frame.l_result.setText(toString(f.c2f(temp)));}
      

    Think I at least know it's involving Double.toString(), but when I end it with .toString(), it keeps saying "double cannot be dereferenced." Actually, it's not even setting text.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  10. Post #3610
    Bazkip's Avatar
    July 2011
    3,181 Posts
    Use two quotation marks to escape it. For example, "This is a ""string"" literal" should come out as:
    Code:
    This is a "string" literal
    Already tried that, didn't work for some reason

    Typically in regex you use back slash to escape characters. so you would put something like "[!%\"]" for your regex. I don't think you need the Regex.Escape part. But I'm not that great with VB
    VB doesn't have the backslash escape character unfortunately
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  11. Post #3611
    Mozartkugeln's Avatar
    August 2012
    967 Posts
    Code:
      formulae f = new formulae();
      final ui frame = new ui();
      double save;
    OOP does not work like that. You're making a new, invisible ui object every time that method is called, and you're putting it in a local variable. You're actually doing the same in the main method. If you want to be able to reference the frame you set-up outside the main method, you must make it an instance field.

    public static void main(String[] args) {
    	final ui frame = new ui();
    	frame.setVisible(true);
    	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    	// etc.
    }
    
    becomes
    private final ui frame = new ui();
    
    public static void main(String[] args) {
    	frame.setVisible(true);
    	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    	// etc.
    }
    

    You will then be able to access the frame you see on the screen anywhere in the class, given that you don't shadow it by making local variables of the same name like you did in the check() method (the line highlighted in the first code snippet, remove it from your code).
    I also have several other gripes with your code: Since you're converting the results you get from the temperature conversion methods in each of the else-if blocks, why not put the Double.toString() calls in those methods and then return the Strings? Also, I don't understand why you would need a separate class just for the formulas.

    Think I at least know it's involving Double.toString(), but when I end it with .toString(), it keeps saying "double cannot be dereferenced." Actually, it's not even setting text.
    Primitive data types don't have any methods; you, therefore, have to use the associated lang classes.

    double d = 1.618
    
    System.out.println(d.toString()) // Syntax error, won't even compile
    System.out.println(Double.toString(d)) // Prints fine
    

    Edited:

    Already tried that, didn't work for some reason
    Hmm, have you tried doing it inside Regex.Escape()?
    Reply With Quote Edit / Delete Windows XP Serbia Show Events

  12. Post #3612
    oc3

    July 2012
    51 Posts
    snip
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  13. Post #3613
    Gold Member
    Lexic's Avatar
    March 2009
    5,782 Posts
    The inside of the FILE structure is nothing to do with you.
    If you get given a non-NULL pointer then either a) you now have a valid file handle or b) your entire OS is broken.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  14. Post #3614
    Gold Member
    esalaka's Avatar
    July 2007
    9,603 Posts
    Why are you even using FILE in C++
    Reply With Quote Edit / Delete Linux Finland Show Events Agree Agree x 2 (list)

  15. Post #3615
    oc3

    July 2012
    51 Posts
    Why are you even using FILE in C++
    Bad habit "/
    It's working fine now after changing to fstream.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  16. Post #3616
    Stonecycle's Avatar
    September 2011
    3,281 Posts
    I also have several other gripes with your code: Since you're converting the results you get from the temperature conversion methods in each of the else-if blocks, why not put the Double.toString() calls in those methods and then return the Strings? Also, I don't understand why you would need a separate class just for the formulas.
    I actually tried this, yet the JLabel won't update.

    frame.l_result.setText(Double.toString(f.c2k(temp)));

    And this:
    private final ui frame = new ui();
    
    public static void main(String[] args) {
    	frame.setVisible(true);
    	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    	// etc.
    }
    

    won't work unless the main() isn't static, and it won't run if it's not a public static void main(String[] args).
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  17. Post #3617
    Mozartkugeln's Avatar
    August 2012
    967 Posts
    I actually tried this, yet the JLabel won't update.
    You're shadowing the frame field with a local variable of the same name. Read my previous post again.

    won't work unless the main() isn't static, and it won't run if it's not a public static void main(String[] args).
    Then make a non-static method and call it from main? :V

    Edited:

    Actually, post your whole class in its current state.
    Reply With Quote Edit / Delete Windows XP Serbia Show Events

  18. Post #3618
    Stonecycle's Avatar
    September 2011
    3,281 Posts
    You're shadowing the frame field with a local variable of the same name. Read my previous post again.



    Then make a non-static method and call it from main? :V

    Edited:

    Actually, post your whole class in its current state.
    Managed to fix it somehow. Now the formatting of the JLabel's all I got left and that I think I can do on my own.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  19. Post #3619
    demoTron's Avatar
    October 2010
    167 Posts
    So after visiting WAYWO I decided to make my own color grid program ( its just a grid with each piece being a random color)
    Using c++ with SFML. It works, but the problem is the CPU usage. If I limit my fps to 60 it still uses about 30%
    My code:
    #include <SFML\Graphics.hpp>
    #include <cstdlib>
    #include <ctime>
    #include <iostream>
    #include <vector>
    
    using namespace std;
    
    int main()
    {
    	//Initialization start
    	srand(time(0));
    	sf::RenderWindow window(sf::VideoMode(640,480),"Color");
    	window.setFramerateLimit(60);
    	vector<sf::RectangleShape> gridvec;
    	sf::RectangleShape grid;
    	
    	grid.setSize(sf::Vector2f(10,10));
    	
    	for ( int x = 0; x < 64; ++x )
    	{
    		for (int y = 0; y < 48; ++y )
    		{
    			grid.setPosition(x*10,y*10);
    			gridvec.push_back(grid);
    			
    		}
    
    	}
    	for (int i = 0; i < gridvec.size();++i)
    	{
    		gridvec[i].setFillColor(sf::Color(rand()%256,rand()%256,rand()%256));
    	}
    	//Initialization end
    	
    	//Main loop
        while (window.isOpen())
        {
            sf::Event event;
            while (window.pollEvent(event))
            {
               
                if (event.type == sf::Event::Closed)
                    window.close();
            }
    		if(sf::Keyboard::isKeyPressed(sf::Keyboard::Space)) //Generates new colors
    		{
    			for (int i = 0; i < gridvec.size();++i)
    			{
    				gridvec[i].setFillColor(sf::Color(rand()%256,rand()%256,rand()%256));
    			}
    		}
    		
    		//Drawing time
    		window.clear();
    		for (int i = 0; i < gridvec.size();++i)
    		{
    			window.draw(gridvec[i]);
    		}
    
    		window.display();
    	}
    	
    }
    

    I guess it's because the rectangles are being redrawn so frequently. Any ideas how to lower it ?
    Reply With Quote Edit / Delete Windows 7 Lithuania Show Events

  20. Post #3620
    Eudoxia's Avatar
    July 2009
    5,323 Posts
    Maybe not the best place to post this, but I was wondering: If I write a binding to a library that includes a function that loads and links the library, and put that binding in my compiler's Standard Library, do I have to change the license? Or does writing bindings not count as license infringement or whatever?
    Reply With Quote Edit / Delete Linux Uruguay Show Events

  21. Post #3621
    Gold Member
    robmaister12's Avatar
    January 2008
    4,746 Posts
    Maybe not the best place to post this, but I was wondering: If I write a binding to a library that includes a function that loads and links the library, and put that binding in my compiler's Standard Library, do I have to change the license? Or does writing bindings not count as license infringement or whatever?
    It depends on the license and the linking method. IANAL, but if you're talking about the GPL, then I think it's that dynamic linking of the library is fine but static linking is not. More permissive (MIT, BSD, zlib, etc.) licenses don't care at all.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  22. Post #3622
    Eudoxia's Avatar
    July 2009
    5,323 Posts
    It depends on the license and the linking method. IANAL, but if you're talking about the GPL, then I think it's that dynamic linking of the library is fine but static linking is not. More permissive (MIT, BSD, zlib, etc.) licenses don't care at all.
    I think my compiler dynamically links things. 'Think' because this not-quite-compile-time-and-not-quite-run-time thing about JIT compilation always confuses me. Thanks.
    Reply With Quote Edit / Delete Linux Uruguay Show Events

  23. Post #3623
    Gold Member
    robmaister12's Avatar
    January 2008
    4,746 Posts
    Dynamic linking means that the licensed library is in it's own separate file. Static linking basically means that the entire library is copied into your library/executable.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  24. Post #3624
    Eudoxia's Avatar
    July 2009
    5,323 Posts
    Dynamic linking means that the licensed library is in it's own separate file. Static linking basically means that the entire library is copied into your library/executable.
    I think both are happening :I
    Reply With Quote Edit / Delete Linux Uruguay Show Events Funny Funny x 3 (list)

  25. Post #3625
    Gold Member
    elevate's Avatar
    April 2012
    2,136 Posts
    How do I get SFML 1.6 (or 2.0) to work with GCC 4.7.0 and Code::Blocks 10.05, both of which are separate and not part of a package like the Code::Blocks/MinGW thing is?

    I am having nothing but problems.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  26. Post #3626
    Gold Member
    ShaunOfTheLive's Avatar
    November 2007
    8,693 Posts
    How do I get SFML 1.6 (or 2.0) to work with GCC 4.7.0 and Code::Blocks 10.05, both of which are separate and not part of a package like the Code::Blocks/MinGW thing is?

    I am having nothing but problems.
    Hmm, it really shouldn't matter that they're not in a package together. As long as GCC can see it, Code::Blocks really has nothing to do with it. Code::Blocks just calls GCC, which then looks for SFML headers and libraries. You can put them directly in the GCC subfolders if you want (that's usually the easiest way).
    Reply With Quote Edit / Delete Windows 8 Canada Show Events

  27. Post #3627
    ElementalCreeds's Avatar
    July 2009
    306 Posts
    Been trying to make a button in VB that can mute a program through the mixer, Anybody know how i could do this, Nothing is really working.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  28. Post #3628
    Gold Member
    elevate's Avatar
    April 2012
    2,136 Posts
    Hmm, it really shouldn't matter that they're not in a package together. As long as GCC can see it, Code::Blocks really has nothing to do with it. Code::Blocks just calls GCC, which then looks for SFML headers and libraries. You can put them directly in the GCC subfolders if you want (that's usually the easiest way).
    Man I got it working. Had to build SFML 2.0 with MinGW w/ GCC 4.7.0.

    For anyone who's interested: http://sfmlcoder.wordpress.com/2011/...th-mingw-make/
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  29. Post #3629
    That Dog
    Ehmmett's Avatar
    March 2009
    10,383 Posts
    what would cause #plr.collision.point to be 0 when plr.collision.point.down.x works as it should?

    Edited:

    in lua. btw

    Edited:

    does the array count not count any sub-array's?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  30. Post #3630
    Gold Member
    Lexic's Avatar
    March 2009
    5,782 Posts
    So after visiting WAYWO I decided to make my own color grid program ( its just a grid with each piece being a random color)
    Using c++ with SFML. It works, but the problem is the CPU usage. If I limit my fps to 60 it still uses about 30%
    My code:
    #include <SFML\Graphics.hpp>
    #include <cstdlib>
    #include <ctime>
    #include <iostream>
    #include <vector>
    
    using namespace std;
    
    int main()
    {
    	//Initialization start
    	srand(time(0));
    	sf::RenderWindow window(sf::VideoMode(640,480),"Color");
    	window.setFramerateLimit(60);
    	vector<sf::RectangleShape> gridvec;
    	sf::RectangleShape grid;
    	
    	grid.setSize(sf::Vector2f(10,10));
    	
    	for ( int x = 0; x < 64; ++x )
    	{
    		for (int y = 0; y < 48; ++y )
    		{
    			grid.setPosition(x*10,y*10);
    			gridvec.push_back(grid);
    			
    		}
    
    	}
    	for (int i = 0; i < gridvec.size();++i)
    	{
    		gridvec[i].setFillColor(sf::Color(rand()%256,rand()%256,rand()%256));
    	}
    	//Initialization end
    	
    	//Main loop
        while (window.isOpen())
        {
            sf::Event event;
            while (window.pollEvent(event))
            {
               
                if (event.type == sf::Event::Closed)
                    window.close();
            }
    		if(sf::Keyboard::isKeyPressed(sf::Keyboard::Space)) //Generates new colors
    		{
    			for (int i = 0; i < gridvec.size();++i)
    			{
    				gridvec[i].setFillColor(sf::Color(rand()%256,rand()%256,rand()%256));
    			}
    		}
    		
    		//Drawing time
    		window.clear();
    		for (int i = 0; i < gridvec.size();++i)
    		{
    			window.draw(gridvec[i]);
    		}
    
    		window.display();
    	}
    	
    }
    

    I guess it's because the rectangles are being redrawn so frequently. Any ideas how to lower it ?
    You only need to redraw the rectangles if they've changed. Try shifting the clear() and draw() calls up into the if statement.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Agree Agree x 2Useful Useful x 1 (list)

  31. Post #3631
    Bazkip's Avatar
    July 2011
    3,181 Posts
    Use two quotation marks to escape it. For example, "This is a ""string"" literal" should come out as:
    Code:
    This is a "string" literal
    Oh wait, wasn't doing it right before, got it to work now

    Dim specialRegex As New Regex("[!%&'*,-./" + Regex.Escape("+*#()$") + ("""""]"))

    Jesus that's ugly. Thanks though!
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  32. Post #3632
    C++, Lua, Java - choose your poison

    January 2012
    691 Posts
    does anyone know where i can get a library or something similar that will allow me to interact with my g15 LCD using C++? (ie drawing text, shapes, etc on the lcd)
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  33. Post #3633
    Taught by John Lua
    MakeR's Avatar
    May 2007
    2,842 Posts
    does anyone know where i can get a library or something similar that will allow me to interact with my g15 LCD using C++? (ie drawing text, shapes, etc on the lcd)
    They keyboard comes with an SDK for C++. Apparently it is located in C:\Program Files\Logitech G15\SDK\.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Useful Useful x 3 (list)

  34. Post #3634
    C++, Lua, Java - choose your poison

    January 2012
    691 Posts
    oh thanks heaps :D
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Friendly Friendly x 1 (list)

  35. Post #3635
    Gold Member
    esalaka's Avatar
    July 2007
    9,603 Posts
    what would cause #plr.collision.point to be 0 when plr.collision.point.down.x works as it should?

    Edited:

    in lua. btw

    Edited:

    does the array count not count any sub-array's?
    Array count counts sequential numeric indices

    Edited:

    Starting from 1, I believe
    Reply With Quote Edit / Delete Linux Finland Show Events

  36. Post #3636
    Is, in fact, a real hedgehog.
    Ezhik's Avatar
    April 2009
    12,645 Posts
    So I'm attempting to create this game idea: http://www.squidi.net/three/entry.php?id=63

    I want to use SFML+Box2D and write it in C++. Is that a good combo?
    Reply With Quote Edit / Delete Windows 8 Russian Federation Show Events

  37. Post #3637
    Gold Member
    elevate's Avatar
    April 2012
    2,136 Posts
    Anyone know how to register for Visual Studio Express 2012 without being part of a business? If it's legal of course.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1 (list)

  38. Post #3638
    HQRSE FUCKER
    ief014's Avatar
    September 2009
    2,579 Posts
    Quick question:
    Is there a way for a c/c++ header file ignore external macros/defines? Perhaps some #pragma directive?

    In vs2010.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  39. Post #3639
    Gold Member
    Lexic's Avatar
    March 2009
    5,782 Posts
    Quick question:
    Is there a way for a c/c++ header file ignore external macros/defines? Perhaps some #pragma directive?

    In vs2010.
    Code:
    #define FOO_ FOO
    #undef FOO
    
    // ...
    
    #define FOO FOO_
    ?
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  40. Post #3640
    Gold Member
    Hypershadsy's Avatar
    February 2008
    2,296 Posts
    They keyboard comes with an SDK for C++. Apparently it is located in C:\Program Files\Logitech G15\SDK\.
    Here's a .NET binding too:
    http://lglcdnet.codeplex.com/
    Reply With Quote Edit / Delete Windows 7 United States Show Events Useful Useful x 1 (list)