CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: m_power_hax

Page 1 of 4 1 2 3 4

Search: Search took 0.04 seconds.

  1. Replies
    5
    Views
    1,142

    Re: Nehe win32window with classes

    You are right about that (and i should probably change the classes). The fact is, there will be only one window, this window is going to draw stuff in opengl.
  2. Replies
    5
    Views
    1,142

    Re: Nehe win32window with classes

    I know I could use a cross-platform GUI library, but the goal here is to learn how to use classes with windows generation.
  3. Replies
    5
    Views
    1,142

    Nehe win32window with classes

    For now i'm trying to create a simple win32 window (to put opengl in it in the future) using classes. I want the code to work in linux as well, so i need a classe for x11window too.
    For now my...
  4. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    Well this thread is now resolved :)!
  5. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    Good news, i was able to make it work! Remember before i was doing it with an average of 9200 miliseconds or so...now the clock time is giving me 960 miliseconds with your solution! I'm more than...
  6. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    1) Oh well i thought it was parsing the "." as well

    2) using double won't show the correct value, using float will show the correct values, but without decimals

    3)here what i do in matlab:...
  7. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    I found one part of the problem : in matlab i was creating the binary file with the array (2097152x4). This probably caused problem, so i switched the array to a row vector (the column vector worked...
  8. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    Good, it is almost working. I used it with my bin file from matlab, which is a 2097152x4 array converted to binary. I don't know if it is readable with your code. I'm not getting the good values in...
  9. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    I understand your example, but it looks like it only send the data from the bin file in one array. Also, what line is sending the data to a buffer? Remember, the 3 first value (x,y,z) should be sent...
  10. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    I thought read and write were C function, not C++ function. But i still don't what would be the difference in sending the data to arrays. I have the feeling things are getting complicated for...
  11. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    Why would i have no parsing to do? I need to send the data to the g_vertices and g_colors vectors! So i have to do parsing? I thought using the text or binary file was the same, just the binary file...
  12. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    I wish i knew how to integrate this code with my code! How do i know if the buffer contain the right amount of data? I mean, each block should contain a specific amount of line from my text file. I...
  13. Replies
    2
    Views
    556

    Re: D3D or OpenGL?

    OpenGL, because you will like it!
  14. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    Thanks for your help OReubens. I could use a binary file instead, because the data is generated via matlab. I could use this http://www.mathworks.com/help/techdoc/ref/fwrite.html to write the array...
  15. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    Alot of people told me to use std:vector instead. I switched my code to use the vector instead of array. I didnt see any improvment.



    g_vertices.resize(arraySize, GLfloat(0.0)); // resize...
  16. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    I just wanted to make the array big enough.
  17. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    I'm using a text file containing the coordinates and the amplitudes of a bunch of particles that i draw in openGL. The coordinates are x,y,z. The amplitude is used for the color, to make something...
  18. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    Right now i'm trying to make this code work but i can't find what is wrong. The data.txt file as 256 lines, with 4 float on each line, that make 1024 values.


    int main()
    {
    HANDLE hFile =...
  19. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    So if i understood correctly, i should use sscanf for each line in order to have something like that in pseudo code :


    line "i" from buffer []= "1.00 1.00 1.00 0.00"
    sscanf (line "i" from buffer...
  20. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    The clock statements are not there because it is a quote of the code you posted. I didn't measure each functional block separately. I put the t1 before opening the file and t2 after closing the file...
  21. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    I was able to make it works. I got 12077 miliseconds using the clock() function. So this solution is slower than my first solution.
  22. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    9125 milliseconds using my first solution. I'm actually looking for a way to use overlapped I/O, so if anyone has a link to some example for reading a file and copying the data in some variable...let...
  23. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    There is not that much difference in the time when debugging the release version from executing the .exe with my first version of the code. So i assume it is the same with the code you proposed and...
  24. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    I can estimate the time in debugging mode (F5). And the time is quite slow between the moment i start reading the file and the moment it crashes. That's the reason i'm telling it is not faster.

    I...
  25. Replies
    76
    Views
    12,391

    Re: Read from file optimization

    I'm timing a release build. #define _SECURE_SCL 0 didnt change anything. I know there is a solution somewhere for reading that file under 2 seconds! I just tried copying the file to memory using...
Results 1 to 25 of 81
Page 1 of 4 1 2 3 4





Click Here to Expand Forum to Full Width

Featured