Jump to content
  • Advertisement

gan

Member
  • Content Count

    388
  • Joined

  • Last visited

Community Reputation

166 Neutral

About gan

  • Rank
    Member
  1. render on a form? There's a lot library out there(CsGL , openTK ) , why you need to do this on your own?
  2. Specifying Custom Marshaling for User-Defined Structs ?
  3. gan

    Bones or Biped (3ds Max)

    Quote:Original post by Aiwendil Hi everyone, When setting up a skeleton for a model for a game, is it better to use a biped or bones in 3ds Max? Does it even matter? Also what is the difference between the Skin and Physique modifiers and which is better for skinning models for games? Thanks I only used 3ds Max for several weeks only, I think: bipe is faster to setup, for animal for human, ... bones need to do manually just my 2cent
  4. I think it's quite subjective, but follow this recommendation: The struct type is suitable for representing lightweight objects such as Point, Rectangle, and Color. Although it is possible to represent a point as a class, a struct is more efficient in some scenarios. For example, if you declare an array of 1000 Point objects, you will allocate additional memory for referencing each object. In this case, the struct is less expensive.
  5. Quote:Original post by EternityZA Quote:Original post by DevFred Can't you just remove the dangerous keys from the keyboard? ;-) LOL. Rip them out! :P or alternitively sqeeze some glue under the delete buttons... problem solved! remove the KB is easier ^_^
  6. Maybe u can try this "TabIndex" property to programmatically change the order: http://msdn.microsoft.com/en-us/library/system.windows.forms.control.tabindex.aspx
  7. Hope this help: java sprite tutorial
  8. what's the value for: Configuration Properties>General>Common Language Runtime Support? Is it "Common Language Runtime Support (/clr)"?? you should have "System", "System.Data", System.XML" referred by default, don't you? when you create a project, do you have this by default ( I am using a VS pro version)? // test1.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); return 0; }
  9. Quote:Original post by pavel989 i made a clr app, but windows::forms doesnt exist there. Have you done what I shown?
  10. GetSystemMetrics Function or .NET wrapper: SystemInformation.VirtualScreen? p/s: fitfool beats me!
  11. gan

    C# writing to a file question

    Quote:Original post by NUCLEAR RABBIT yah that would work, but i was wondering because I wanted to do a for loop to write everything in the txt file so it would display like this: (without having the numbers in the txt file) 1) omg! 2) poop! 3) next line 4) etc. for-loop? You don't want to use ReadToEnd()? While-loop with StreamReader.ReadLine would be better: using System; using System.IO; using System.Collections.Generic; using System.Text; namespace WritingToAFile { class Program { static void Main(string[] args) { write(); read(); Console.ReadLine(); } static void write() { TextWriter tw = new StreamWriter("date.txt"); tw.WriteLine("omg!"); tw.WriteLine("poop!"); tw.Close(); } static void read() { //TextReader tr = new StreamReader("date.txt"); //Console.WriteLine(tr.ReadToEnd()); //Console.ReadKey(); //tr.Close(); using (StreamReader sr = new StreamReader("date.txt")) { while (sr.Peek() >= 0) { Console.WriteLine(sr.ReadLine()); } } } } }
  12. Maybe take a look at Delegate will help your design as well.
  13. gan

    MDI- Child problem

    it's something similar to this: (I did not write these code, just I forgot where I took it, most probably from CodeProject ) #include <windows.h> #include <commctrl.h> #include "resource.h" #pragma comment(lib, "comctl32") const char g_szClassName[] = "myWindowClass"; const char g_szChildClassName[] = "myMDIChildWindowClass"; #define IDC_MAIN_MDI 101 #define IDC_CHILD_EDIT 101 #define ID_MDI_FIRSTCHILD 50000 HWND g_hMDIClient = NULL; HWND g_hMainWindow = NULL; HWND CreateNewMDIChild(HWND hMDIClient); LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK MDIChildWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); BOOL SetUpMDIChildWindowClass(HINSTANCE hInstance); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { WNDCLASSEX wc; HWND hwnd; MSG Msg; InitCommonControls(); wc.cbSize = sizeof(WNDCLASSEX); wc.style = 0; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.lpszMenuName = MAKEINTRESOURCE(IDR_MAINMENU); wc.lpszClassName = g_szClassName; wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); if(!RegisterClassEx(&wc)) { MessageBox(NULL, "Window Registration Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK); return 0; } if(!SetUpMDIChildWindowClass(hInstance)) return 0; hwnd = CreateWindowEx( 0, g_szClassName, "Multiple-Document Interface", WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, 480, 320, NULL, NULL, hInstance, NULL); if(hwnd == NULL) { MessageBox(NULL, "Window Creation Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK); return 0; } g_hMainWindow = hwnd; ShowWindow(hwnd, nCmdShow); UpdateWindow(hwnd); while(GetMessage(&Msg, NULL, 0, 0) > 0) { if (!TranslateMDISysAccel(g_hMDIClient, &Msg)) { TranslateMessage(&Msg); DispatchMessage(&Msg); } } return Msg.wParam; } HWND CreateNewMDIChild(HWND hMDIClient) { MDICREATESTRUCT mcs; HWND hChild; mcs.szTitle = "[Untitled]"; mcs.szClass = g_szChildClassName; mcs.hOwner = GetModuleHandle(NULL); mcs.x = mcs.cx = CW_USEDEFAULT; mcs.y = mcs.cy = CW_USEDEFAULT; mcs.style = MDIS_ALLCHILDSTYLES; hChild = (HWND)SendMessage(hMDIClient, WM_MDICREATE, 0, (LONG)&mcs); if(!hChild) { MessageBox(hMDIClient, "MDI Child creation failed.", "Oh Oh...", MB_ICONEXCLAMATION | MB_OK); } return hChild; } LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CREATE: { CLIENTCREATESTRUCT ccs; // Create MDI Client // Find window menu where children will be listed ccs.hWindowMenu = GetSubMenu(GetMenu(hwnd), 2); ccs.idFirstChild = ID_MDI_FIRSTCHILD; g_hMDIClient = CreateWindowEx(WS_EX_CLIENTEDGE, "mdiclient", NULL, WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hwnd, (HMENU)IDC_MAIN_MDI, GetModuleHandle(NULL), (LPVOID)&ccs); if(g_hMDIClient == NULL) MessageBox(hwnd, "Could not create MDI client.", "Error", MB_OK | MB_ICONERROR); } break; case WM_SIZE: { HWND hMDI; int iMDIHeight; RECT rcClient; // Calculate remaining height and size edit GetClientRect(hwnd, &rcClient); iMDIHeight = rcClient.bottom; hMDI = GetDlgItem(hwnd, IDC_MAIN_MDI); SetWindowPos(hMDI, NULL, 0, 0, rcClient.right, iMDIHeight, SWP_NOZORDER); } break; case WM_CLOSE: DestroyWindow(hwnd); break; case WM_DESTROY: PostQuitMessage(0); break; case WM_COMMAND: switch(LOWORD(wParam)) { case IDM_FILE_EXIT: PostMessage(hwnd, WM_CLOSE, 0, 0); break; case IDM_FILE_NEW: CreateNewMDIChild(g_hMDIClient); break; default: { if(LOWORD(wParam) >= ID_MDI_FIRSTCHILD) { DefFrameProc(hwnd, g_hMDIClient, WM_COMMAND, wParam, lParam); } else { HWND hChild = (HWND)SendMessage(g_hMDIClient, WM_MDIGETACTIVE,0,0); if(hChild) { SendMessage(hChild, WM_COMMAND, wParam, lParam); } } } } break; default: return DefFrameProc(hwnd, g_hMDIClient, msg, wParam, lParam); } return 0; } LRESULT CALLBACK MDIChildWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CREATE: { HWND hEdit; // Create Edit Control hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL, 0, 0, 100, 100, hwnd, (HMENU)IDC_CHILD_EDIT, GetModuleHandle(NULL), NULL); if(hEdit == NULL) MessageBox(hwnd, "Could not create edit box.", "Error", MB_OK | MB_ICONERROR); } break; case WM_SIZE: { HWND hEdit; RECT rcClient; // Calculate remaining height and size edit GetClientRect(hwnd, &rcClient); hEdit = GetDlgItem(hwnd, IDC_CHILD_EDIT); SetWindowPos(hEdit, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER); } return DefMDIChildProc(hwnd, msg, wParam, lParam); default: return DefMDIChildProc(hwnd, msg, wParam, lParam); } return 0; } BOOL SetUpMDIChildWindowClass(HINSTANCE hInstance) { WNDCLASSEX wc; wc.cbSize = sizeof(WNDCLASSEX); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = MDIChildWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_3DFACE+1); wc.lpszMenuName = NULL; wc.lpszClassName = g_szChildClassName; wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); if(!RegisterClassEx(&wc)) { MessageBox(0, "Could Not Register Child Window", "Oh Oh...", MB_ICONEXCLAMATION | MB_OK); return FALSE; } else return TRUE; }
  14. gan

    Symbian game development starter

    Have you visited forumNokia ? It's S60's MSDN. For more documentation, it's here.
  15. Managed Cpp/CLI? Right-click your project, "Common properties"->"Reference"->"Add new Reference": // test.cpp : main project file. #include "stdafx.h" using namespace System; using namespace System::Windows::Forms; int main(array<System::String ^> ^args) { Console::WriteLine(String::Concat( "The path for the executable file", " that started the application is: ", Application::StartupPath )); return 0; }
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!