Jump to content

IgorBgz90

Supporters
  • Content Count

    37
  • Joined

  • Last visited

Community Reputation

14 Good

About IgorBgz90

  • Rank
    Advanced Member
  • Birthday 09/07/1990

Profile Information

  • Gender
    Male
  • Location
    Russia

Recent Profile Visitors

2,576 profile views
  1. IgorBgz90

    Vehicle!

    Hi! Vehicle Physics It would be cool to add Joint:Wheel! Or give the ability to set the speed separately, for each of the wheels (example SetAcceleration(gas,tireIndex)). Аnd to individually rotate each of the wheels (example SetSteering(steering, tireIndex))! Sorry for my bad English(
  2. Hi Josh, A couple of years ago I made my dedicated server (app) for minecraft=), there for interception from the console I used pipes. But, this is works only in windows. #include <windows.h> #include <iostream> #include <string> #include <stdio.h> #pragma warning(disable : 4996) // For GetVersionEx #define bzero(a) memset(a,0,sizeof(a)) char buf[1024]; STARTUPINFO si; SECURITY_ATTRIBUTES sa; SECURITY_DESCRIPTOR sd; PROCESS_INFORMATION pi; HANDLE newstdin, newstdout, read_stdout, write_stdin; unsigned long bread; unsigned long avail; bool IsWinNT() { OSVERSIONINFO osv; osv.dwOSVersionInfoSize = sizeof(osv); GetVersionEx(&osv); return (osv.dwPlatformId == VER_PLATFORM_WIN32_NT); } std::wstring s2ws(const std::string& s) { int len; int slength = (int)s.length() + 1; len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0); wchar_t* buf = new wchar_t[len]; MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, buf, len); std::wstring r(buf); delete[] buf; return r; } bool CreateAnonymousPipes(std::string procName) { if (IsWinNT()) { InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION); SetSecurityDescriptorDacl(&sd, true, NULL, false); sa.lpSecurityDescriptor = &sd; } else { sa.lpSecurityDescriptor = NULL; } sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.bInheritHandle = true; //CreatePipe(&newstdin, &write_stdin, &sa, 0); //stdin CreatePipe(&read_stdout, &newstdout, &sa, 0); //stdout GetStartupInfo(&si); si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; si.hStdOutput = newstdout; si.hStdError = newstdout; //si.hStdInput = newstdin; std::wstring stemp = std::wstring(procName.begin(), procName.end()); if (CreateProcess(stemp.c_str(), NULL, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, π)) { return true; } bzero(buf); return false; } // Child process stdout void ReceiveChild() { PeekNamedPipe(read_stdout, buf, 1023, &bread, &avail, NULL); if (bread != 0) { bzero(buf); if (avail > 1023) { while (bread >= 1023) { ReadFile(read_stdout, buf, 1023, &bread, NULL); bzero(buf); } } else { ReadFile(read_stdout, buf, 1023, &bread, NULL); if (buf != "") { std::cout << buf << std::endl; // STDOUT } } } } int main(int argc, char** argv) { std::string filename; if (argc > 1) { std::cout << argv[1] << std::endl; filename = argv[1]; } bool start = CreateAnonymousPipes(filename); // Windowed app start while (start) { Sleep(1); ReceiveChild(); } return 0; }
  3. IgorBgz90

    wchar_t ro xchar2b?

    Hi Josh! Maybe this will help: Code from here: http://xopendisplay.hilltopia.ca/2009/Mar/ int utf8toXChar2b(XChar2b *output_r, int outsize, const char *input, int inlen){ int j, k; for(j =0, k=0; j < inlen && k < outsize; j ++){ unsigned char c = input[j]; if (c < 128) { output_r[k].byte1 = 0; output_r[k].byte2 = c; k++; } else if (c < 0xC0) { /* we're inside a character we don't know */ continue; } else switch(c&0xF0){ case 0xC0: case 0xD0: /* two bytes 5+6 = 11 bits */ if (inlen < j+1){ return k; } output_r[k].byte1 = (c&0x1C) >> 2; j++; output_r[k].byte2 = ((c&0x3) << 6) + (input[j]&0x3F); k++; break; case 0xE0: /* three bytes 4+6+6 = 16 bits */ if (inlen < j+2){ return k; } j++; output_r[k].byte1 = ((c&0xF) << 4) + ((input[j]&0x3C) >> 2); c = input[j]; j++; output_r[k].byte2 = ((c&0x3) << 6) + (input[j]&0x3F); k++; break; case 0xFF: /* the character uses more than 16 bits */ continue; } } return k; } And convert char* to wchar_t wchar_t * filename= L"C:\\test"; char* c = (char*)filename;
  4. IgorBgz90

    What are you working on :

    Yes, you are absolutly right. But I do not know for what reason I do not make the indexes. Thanks for test Brutile! The error due to lack of microsoft visual c++ 2015 redistributable. Update: Added ebo const float rect[] = { x, y, 0.0f, 0.0f, 0.0f, x + width, y, 0.0f, 1.0f, 0.0f, x, y + height, 0.0f, 0.0f, 1.0f, //x, y + height, 0.0f, 0.0f, 1.0f, //x + width, y, 0.0f, 1.0f, 0.0f, x + width, y + height, 0.0f, 1.0f, 1.0f }; GLuint elements[] = { 0, 1, 2, 2, 1, 3 };
  5. IgorBgz90

    What are you working on :

    2D Karl! Today finished with optimization, should work even Tetris. 1606 sprites! One sprite 6 vertex 2 triangle. This is my simple 2D "engine", I may be selling it for $1.000.000, and buy a graphics card for Leadwerks Engine . Need your help in testing. I want to make sure that not only works for me. Camera move: Up Down Left Right Hit Escape key to exit System requirements: Graphic card with support OpenGL 3.3 and shader model 3.0 Download Release 2D Engine.zip
  6. IgorBgz90

    What are you working on :

    My first rectangle in OpenGL 3.3 (SDL2 / GLEW / C++) and simple framework for work .
  7. Sorry guys for my long absence and inactivity in the community. My graphics card does not support the OpenGL 4+ :( Happy New Year and Mery Christmas.

    1. shadmar

      shadmar

      Get back here, you were doing great :-)

    2. IgorBgz90

      IgorBgz90

      Thanks Shad ;). Need time to upgrade PC. Glad to see you!

  8. Sorry guys for my long absence and inactivity in the community. My graphics card does not support the OpenGL 4+ :(

  9. New video in my channel. ObjectGUI https://www.youtube.com/watch?v=kokuoTM_RKY

    1. Show previous comments  3 more
    2. BES

      BES

      good job...looks good

    3. beo6

      beo6

      like it too. how do you handle different resolutions?

    4. Slastraf

      Slastraf

      looks good, am going to get this 8/8 m8

  10. Leadwerks not working with luac files? I get error "cannot load incompatible bytecode".

    1. Josh

      Josh

      Sounds like what it says. Leadwerks uses Lua 5.1.4.

  11. IgorBgz90

    Multiple Text [GUI]

    Looks complicated . The idea is good.
  12. IgorBgz90

    Multiple Text [GUI]

    Let it be here. Suddenly come in handy!
  13. IgorBgz90

    Multiple Text [GUI]

    A simple example of a multiple text. function App:Start() self.maxTextWidth = 128 self.sourceText = "Text" self.tempText = "" self.text={} self.lineCount = 0 for w in string.gmatch(self.sourceText, "[%p%a%d]+") do if defaultfont:GetTextWidth(self.tempText) < self.maxTextWidth then self.tempText = self.tempText.." "..w else --We need to find the last word, learn length, and delete it. local temp1 = string.reverse(self.tempText) local temp2 = string.sub(temp1, 1, string.find(temp1," ")) temp2 = string.reverse(temp2) local temp3 = string.sub(self.tempText, 1, string.len(self.tempText)-string.len(temp2)) --Add new line to list. self.text[self.lineCount] = temp3 self.lineCount = self.lineCount + 1 self.tempText = "" --Now we can add the last word to new line. self.tempText = self.tempText..temp2.." "..w end end self.text[self.lineCount] = self.tempText self.lineCount = self.lineCount + 1 self.tempText = "" return true end function App:Loop() --Test text self.context:SetBlendMode(Blend.Alpha) self.context:SetColor(1,1,1,1) for i=0,self.lineCount,1 do self.context:DrawText(self.text[i],150,(150)+15*i); end self.context:SetBlendMode(Blend.Solid) self.context:Sync(true) return true end
  14. IgorBgz90

    Fonts [Solved]

    Problem here: button.defaultfont = context:GetFont() It works: button.defaultfont = Font:Load("Fonts/Arial.ttf",15)
  15. IgorBgz90

    Fonts [Solved]

    Hi! I cannot understand how to use your font for button. And then use a standard font. --Font local context = Context:GetCurrent() button.font = Font:Load("Fonts/Test.ttf",32) --Custom button.defaultfont = context:GetFont() --Arial button.color = Vec4(1.0) Pay attention! I do not release fonts from memory. function Button:Draw() local context = Context:GetCurrent() local window = Window:GetCurrent() if self.enable then if self.visible then context:SetBlendMode(Blend.Alpha) --Set user font if self.font then context:SetFont(self.font) else self.font = self.defaultfont end context:DrawText(self.title,25,25) --Set default font context:SetFont(self.defaultfont) context:SetBlendMode(Blend.Solid) end end end Log: Maybe I'm doing something wrong?
×