Changeset 212


Ignore:
Timestamp:
Feb 21, 2011, 11:02:38 PM (14 years ago)
Author:
Apollo Demetrious Sharpe
Message:

Improved Begin() & implemented End().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified pipeline/cpp_pipeline/lib/glapi.cpp

    r168 r212  
    2828#include <ddk\GL\gldebug.h>
    2929#include "context.h"
     30#include "pipeline.h"
     31#include "nuggets.h"
    3032
    3133
     
    478480    GLCALLED();
    479481
    480     if(!ctx) {
     482    Context *pcCtx = GET_PIPE_CTX(uToken[CMD_PGLCONTEXT])
     483    NUGGET *psPrimeNugget;
     484
     485    if(!pcCtx) {
    481486        GLDEBUG("Context does not exist\n");
    482487        GLFINISHED();
     
    484489    }
    485490
    486     Context *pcCtx = (Context *)ctx->pPipeCtx;
     491    /* Toggle Begin/End mode */
     492     pcCtx->bBegin = true;
    487493
    488494    GLDEBUG("Resetting context\n");
    489495    pcCtx->Reset();
    490496
    491     pcCtx->nPrimitive = mode;
     497    pcCtx->nPrimitive = uToken[CMD_FIRSTARG];
     498
     499    psPrimeNugget = _create_nugget();
     500    psPrimeNugget->eType = NUG_START_PRIM;
     501    psPrimeNugget->nPrimative = pcCtx->nPrimitive;
     502
     503    if(!_add_nugget(&pcCtx->sStream, psPrimeNugget)) {
     504        GLDEBUG("Failed to add nugget the stream\n");
     505    }
    492506
    493507    GLFINISHED();
     
    497511{
    498512    GLCALLED();
     513
     514    Context *pcCtx = GET_PIPE_CTX(uToken[CMD_PGLCONTEXT])
     515
     516    if(!pcCtx) {
     517        GLDEBUG("Context does not exist\n");
     518        GLFINISHED();
     519        return;
     520    }
     521
     522    /* Toggle Begin/End mode */
     523    pcCtx->bBegin = false;
     524
     525    psPrimeNugget = _create_nugget();
     526    psPrimeNugget->eType = NUG_END_PRIM;
     527    psPrimeNugget->nPrimative = pcCtx->nPrimitive;
     528
     529    if(!_add_nugget(&pcCtx->sStream, psPrimeNugget)) {
     530        GLDEBUG("Failed to add nugget the stream\n");
     531    }
     532
     533    pcBigPipe->Emit(uToken[CMD_PGLCONTEXT]);
     534
    499535    GLFINISHED();
    500536}
Note: See TracChangeset for help on using the changeset viewer.