ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [ecere] 요약...
    게임 프로그래밍/[엔진] 오픈소스 2012. 3. 13. 11:58
    DevMaster.net 피드를 통해서 알게 된 엔진. 멀티 플랫폼 기반에 BSD 라이센스 적용.
    IDE, eC(객체지향 C 정도 된다고 함) eC 는 스크립트가 아니라 네이티브라고 함. IDE, SDK 를 eC 로 개발했고 c 와 링크도 된다고 함. eC sharp 라고 하는것도 언뜻 본것 같긴한데 일단 간략한 소스를 보니 너무 씸플해 보임.
    소스를 구할 수 있는곳은 대부분 오픈소스 프로젝트를 호스팅 하는 곳에서는 다 구할 수 있는듯 너무 많음;


    국민 예제..
    class HelloApp : Application
    {
       void Main()
       {
          PrintLn("Hello, World!!");
       }
    }
    


    gui 코드도 살짝 살펴보면..
    // ecas -- By Joey Adams
    import "ecere"
    import "expression"
    
    class Form1 : Window
    {
       text = "Simple Parser";
       background = activeBorder;
       borderStyle = sizable;
       hasMaximize = true;
       hasMinimize = true;
       hasClose = true;
       size = { 576, 432 };
       anchor = { horz = -3, vert = -4 };
    
       bool OnCreate(void)
       {
          
          return true;
       }
    
       bool OnKeyHit(Key key, unichar ch)
       {
          if (ch=='\r')
             DoParse(true);
          
          return true;
       }
    
       void DoParse(bool simplify) {
          EditBoxStream s;
          CASDictionary dict {};
          Expression expr {};
          Expression exprCopy;
          outputTree.Clear();
          s = {editBox=outputTree};
          if (expr.FromString(inputString.contents, dict)) {
             statusLabel.SetText("Parse successful");
             if (simplify)
                expr.Simplify(dict);
          }
          else
             statusLabel.SetText("Invalid expression");
          expr.DebugPrint(s, dict, 0, null);
          s.Printf("\nCopy:\n");
          exprCopy = expr.Copy(null);
          delete expr;
          exprCopy.DebugPrint(s, dict, 0, null);
          delete s;
          delete dict;
          delete exprCopy;
       }
    
       Button parseButton
       {
          this, text = "Parse", size = { 75, 30 }, position = { 10, 40 };
    
          bool NotifyClicked(Button button, int x, int y, Modifiers mods)
          {
             DoParse(false);
             return true;
          }
       };
       Button simplifyButton
       {
          this, text = "Simplify", size = { 75, 30 }, position = { 90, 40 };
    
          bool NotifyClicked(Button button, int x, int y, Modifiers mods)
          {
             DoParse(true);
             return true;
          }
       };
    
       bool TypeButton(Button button, int x, int y, Modifiers mods) {
          inputString.Activate();
          inputString.Deselect();
          inputString.AddS(button.text);
          inputString.Update(null);
       }
       Label statusLabel { this, size = { 274, 21 }, position = { 250, 45 } };
       Button ebutton { this, text = constant_string[e], NotifyClicked = TypeButton, size = { 20, 20 }, position = { 170, 45 } };
       Button ibutton { this, text = constant_string[i], NotifyClicked = TypeButton, size = { 20, 20 }, position = { 195, 45 } };
       Button pibutton { this, text = constant_string[pi], NotifyClicked = TypeButton, size = { 20, 20 }, position = { 220, 45 } };
       EditBox outputTree { this, font = { "Courier New", 10 }, size = { 286, 219 }, position = { 10, 80 }, hasHorzScroll = true, true, readOnly = true, true };
       EditBox inputString { this, text = "inputString", size = { 350, 19 }, position = { 10, 10 } };
    
       void OnResize(int width, int height)
       {
          inputString.size.w = clientSize.w-20;
          //parseButton.position.x = (clientSize.w-parseButton.size.w)/2;
          statusLabel.size.w = clientSize.w-statusLabel.position.x-10;
          outputTree.size.w = clientSize.w-20;
          outputTree.size.h = clientSize.h-outputTree.position.y-10;
       }
    }
    
    Form1 form1 {};
    

    일단은 여기까지..   3월 21일 추가 -----
    음 간단한 내용을 컴파일해보고 ide 를 돌려본 결과.. 생각만큼의 퀄리티가 나오지 않더라 하는 깨닳음을 얻음. 그리고 ec 포멧을 컴파일 하는 중간 파일이 c 파일이 나와서 그것이 컴파일 되는것으로 보임.

    '게임 프로그래밍 > [엔진] 오픈소스' 카테고리의 다른 글

    [irrlicht-1.7] 요약...  (0) 2012.03.13
Designed by Tistory.